Dateadd

chrismof

New member
Local time
Today, 10:35
Joined
Sep 19, 2015
Messages
4
Hi can anyone help me with problem. I am trying to set up a query I need to use the current date but for checking on overdue payment of invoices plus the payment terms ie invoice date plus 30 days from the invoices date and then adding another days as the days role on I would appreciate it if anyone could help.

Thanks
Chris
 
Could you please demonstrate your issue with data? Give me 2 sets:

A - starting sample data from your table(s). Include table and field names and enough data to cover all cases.

B - expected data from your query. Based on the data you provide in A, show what the query should return.
 
Hi Plog
Thanks for your reply, the fields on my query are invoice date, payment terms, days over due. What I am trying to achieve is entering data into invoice date and then adding payment terms. From that point calculating the amount of days the payment is over due. I would have thought using dateadd I would be able to add the the payment terms to the invoice date. Hopefully this may help.

Thanks
Chris
 
Well . . .
Code:
DueDate = InvoiceDate + Terms
. . . correct? And then . . .
Code:
DaysOverdue = Date() - DueDate
. . . right? So, as a single expression . . .
Code:
DaysOverdue = Date() - InvoiceDate + Terms
Does that make sense? Does the yield the result you expect?
 
Hopefully this may help.

Nope. Hopefully Mark's advice did it for you, if not and would like me to assist you, please provided me with what I asked for.
 
Don't we need some brackets?


DaysOverdue = Date() - (InvoiceDate + Terms)

Brian
 
Hi Guys thanks for your reply I am new to entering code on access so if you could bear with me I would appreciate it. I've entered the code
"Over Due: [DaysOverDue]=Date()-([InvoiceDate]+[Terms])" when |I run it the program asks for a parameter value days over due and a parameter InvoiceDate. I was going to attach a screen shot but their is nowhere to attach.

Thanks
Chris
 
The code as provided has no spaces in the field names but I see that your query does, personally I never have spaces in object names be they field, control, table etc etc, but you need to ensure that what you code is consistent.

Brian
 
Don't we need some brackets?

DaysOverdue = Date() - (InvoiceDate + Terms)

Brian
Doh, yes, you need the brackets.

And with this . . .
Code:
Over Due: [DaysOverDue]=Date()-([InvoiceDate]+[Terms])
. . . you probably mean . . .
Code:
DaysOverdue: Date()-([InvoiceDate]+[Terms])
 

Users who are viewing this thread

Back
Top Bottom