add an integer to Date the get Date?

A

aa

I have a table "Invoices" containing, among other things, the date of the
invoice, as type Date
I have another table "Customers" containing, among other things, the credit
terms for each customer (like 30 days, 60 days etc) as type Integer.

How do I build a query to show the invoice payment due date, i.e. how do I
add an integer to Date the get Date?
 
R

Roger Carlson

Simply add it to the date. A date is stored internally as a Double
precision number, so you should just be able to do:
DueDate: InvoiceDate + 30
You can also use the DateAdd funtion:
DueDate: DateAdd("d", 30, InvoiceDate)

The nice thing about DateAdd is that you can add days or weeks, or months,
or quarters, or a whole bunch of other intervals. But there is no real
advantage when using days.
 
D

Douglas J. Steele

BerHav said:
This works as Dates are nothing other than numbers for Access, Day 1 =
01/Jan/1900.

<pedantic>
Actually, Day 1 is 31 Dec, 1899. This is because Microsoft decided to
perpetuate an error made in Lotus 1-2-3 to make conversion simpler when they
produced Excel, and they had to keep it to simplify inter-application
operability.
</pedantic>
 
E

EDUARDO PICCINI

aa said:
I have a table "Invoices" containing, among other things, the date of the
invoice, as type Date
I have another table "Customers" containing, among other things, the credit
terms for each customer (like 30 days, 60 days etc) as type Integer.

How do I build a query to show the invoice payment due date, i.e. how do I
add an integer to Date the get Date?
 
T

Tom Ellison

Dear Eduardo:

Please refer to the DateAdd function in online help or your favorite
printed reference. This has just what you need.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top