这是表,这是我的查询。
MyCommand.CommandText = "SELECT FS_Expenses.ID, FS_Expenses.FS_Date, FS_Expenses.SupplierID, " & _
"FS_Expenses.Total, FS_Expenses.PaymentType, FS_Expenses.PaymentDate, " & _
"FS_Expenses.TotalPayment, FS_Expenses.PaymentDue, " & _
"Supplier.SupplierName, " & _
"Supplier.Address, Supplier.ContactNo, " & _
"Supplier.EmailID FROM " & _
"(FS_Expenses INNER JOIN Supplier ON FS_Expenses.SupplierID = Supplier.SupplierID) " & _
"where FS_Date between #" & DateFrom.Value.Date & "# And #" & DateTo.Value.Date & "# order by FS_Date"
我相信它是因为两个供应商ID(来自另一个表的主键)不应该在同一个字段中共存,因此,"无法启用约束。一行或多行包含违反非null,唯一或外键约束的值。" 如果只有1个供应商ID,则没有错误。
但我需要在我生成的报告中显示超过这些ID。
我该怎么办?
感谢您的任何想法!
(SupplierID是文字类型)