Hello everyone,
I was recently tasked to convert some of the functions employees use Excel for into Access. One of these functions is seeing which invoices are due to be paid this month. Surely this is simple I thought, and so it would be - if I had a field with a duedate in it. However I am using the sum of two fields as my date and thus, I feel, I have a problem. It's the end of the day and I'm knackered, can anyone spot my Query error?
The below code is one of the many different ways I've tried to skin this cat...
(There are plenty of records with both [TermsDays] AND [TermsDate] NULL.)
In Query; Datatype mismatch in this case. I assume with the DateAdd?
Any help would be greatly appreciated.
John
I was recently tasked to convert some of the functions employees use Excel for into Access. One of these functions is seeing which invoices are due to be paid this month. Surely this is simple I thought, and so it would be - if I had a field with a duedate in it. However I am using the sum of two fields as my date and thus, I feel, I have a problem. It's the end of the day and I'm knackered, can anyone spot my Query error?
The below code is one of the many different ways I've tried to skin this cat...
(There are plenty of records with both [TermsDays] AND [TermsDate] NULL.)
In Query; Datatype mismatch in this case. I assume with the DateAdd?
Code:
SELECT tblPurchaseOrderDetail.*, tblPurchaseOrderDetail.TermsDays, tblPurchaseOrderDetail.TermsDate
FROM tblPurchaseOrdersHeader INNER JOIN tblPurchaseOrderDetail ON tblPurchaseOrdersHeader.OrderNumber = tblPurchaseOrderDetail.OrderNumber
WHERE (((tblPurchaseOrderDetail.TermsDate) Is Not Null) AND ((DateAdd("d",[TermsDays],[TermsDate]))>=DateSerial(Year(Now()),Month(Now()),1) And (DateAdd("d",[TermsDays],[TermsDate]))<DateSerial(Year(Now()),Month(Now()),1)));
John
Comment