K
Ken Lewis
The MS Access query below requires a date input. It runs perfectly with the dates 9/30/2009 or 12/31/2009, but fails with the subject error on dates of 10/31/2009 or 11/30/2009.
Can the error be caused by data in the tables themselves and any suggestions on how to adjust the query to avoid potential problem dates?
Thanks
SELECT tRecordsInventory.SCMContact, tRecordsInventory.BusUnitOwner, tDepartment.DepartmentNo, tRecordsInventory.PartyName, tRecordsInventory.Title, tRecordsInventory.DocScope, tRecordsInventory.ContractNumber, tRecordsInventory.ExpirationDate AS [Expiration-Date], tRecordsInventory.GeographicCoverage, tRecordsInventory.ReviewInterval
FROM tContractType RIGHT JOIN ((tStatus RIGHT JOIN (tAreaHeld RIGHT JOIN tRecordsInventory ON tAreaHeld.ID=tRecordsInventory.AreaHeld_id) ON tStatus.ID=tRecordsInventory.Status_id) LEFT JOIN tDepartment ON tRecordsInventory.Department_id=tDepartment.ID) ON tContractType.ID=tRecordsInventory.ContractType_id
WHERE (((tRecordsInventory.ExpirationDate)>(Forms!frmReports!ReportDate1)) And ((tRecordsInventory.ReviewInterval)>0) And ((tAreaHeld.AreaHeld)<>"Museum" And (tAreaHeld.AreaHeld)<>"HBS Facilities") And ((tStatus.StatusDescription)<>"Expired/Terminated" And (tStatus.StatusDescription)<>"Active") And ((DateAdd("d",CInt([tRecordsInventory.ReviewInterval])+15,Forms!frmReports!ReportDate1))>tRecordsInventory.ExpirationDate) And ((IsNull([expirationdate]))=False))
ORDER BY CInt(tDepartment.DepartmentNo);
EggHeadCafe - Software Developer Portal of Choice
WPF DataGrid Custom Paging and Sorting
http://www.eggheadcafe.com/tutorial...f-32b2d802ae17/wpf-datagrid-custom-pagin.aspx
Can the error be caused by data in the tables themselves and any suggestions on how to adjust the query to avoid potential problem dates?
Thanks
SELECT tRecordsInventory.SCMContact, tRecordsInventory.BusUnitOwner, tDepartment.DepartmentNo, tRecordsInventory.PartyName, tRecordsInventory.Title, tRecordsInventory.DocScope, tRecordsInventory.ContractNumber, tRecordsInventory.ExpirationDate AS [Expiration-Date], tRecordsInventory.GeographicCoverage, tRecordsInventory.ReviewInterval
FROM tContractType RIGHT JOIN ((tStatus RIGHT JOIN (tAreaHeld RIGHT JOIN tRecordsInventory ON tAreaHeld.ID=tRecordsInventory.AreaHeld_id) ON tStatus.ID=tRecordsInventory.Status_id) LEFT JOIN tDepartment ON tRecordsInventory.Department_id=tDepartment.ID) ON tContractType.ID=tRecordsInventory.ContractType_id
WHERE (((tRecordsInventory.ExpirationDate)>(Forms!frmReports!ReportDate1)) And ((tRecordsInventory.ReviewInterval)>0) And ((tAreaHeld.AreaHeld)<>"Museum" And (tAreaHeld.AreaHeld)<>"HBS Facilities") And ((tStatus.StatusDescription)<>"Expired/Terminated" And (tStatus.StatusDescription)<>"Active") And ((DateAdd("d",CInt([tRecordsInventory.ReviewInterval])+15,Forms!frmReports!ReportDate1))>tRecordsInventory.ExpirationDate) And ((IsNull([expirationdate]))=False))
ORDER BY CInt(tDepartment.DepartmentNo);
EggHeadCafe - Software Developer Portal of Choice
WPF DataGrid Custom Paging and Sorting
http://www.eggheadcafe.com/tutorial...f-32b2d802ae17/wpf-datagrid-custom-pagin.aspx