subtract dates

A

a

Thank you
begin date end date subtract number in days
1/1/2004 5/1/2004 4
15/1/2004 20/1/2004 5

I want (question):
When subtract date display result in dates not number
Example:
1/1/2004
2/1/2004
3/1/2004
4/1/2004
 
J

John Vinson

Thank you
begin date end date subtract number in days
1/1/2004 5/1/2004 4
15/1/2004 20/1/2004 5

I want (question):
When subtract date display result in dates not number
Example:
1/1/2004
2/1/2004
3/1/2004
4/1/2004

Use the DateDiff function:

NumberInDays: DateDiff("d", [begin date], [end date])

A Date/Time field is stored as a Double Float number, a count of days
and fractions of a day since midnight, December 30, 1899. Recheck your
example: I suspect that if you subtract 1/1/2004 from 1/5/2004 (using
American date formatting, which is *REQUIRED* if you use literal dates
in SQL queries) you will get #1/3/1900# and not any date in 2004!
 
A

a

Mr John w. vinson [MVP]
thank you for your help and answer:
but I want to tell you that your answer also give me subtaction by number
not dates:






John Vinson said:
Thank you
begin date end date subtract number in days
1/1/2004 5/1/2004 4
15/1/2004 20/1/2004 5

I want (question):
When subtract date display result in dates not number
Example:
1/1/2004
2/1/2004
3/1/2004
4/1/2004

Use the DateDiff function:

NumberInDays: DateDiff("d", [begin date], [end date])

A Date/Time field is stored as a Double Float number, a count of days
and fractions of a day since midnight, December 30, 1899. Recheck your
example: I suspect that if you subtract 1/1/2004 from 1/5/2004 (using
American date formatting, which is *REQUIRED* if you use literal dates
in SQL queries) you will get #1/3/1900# and not any date in 2004!
 

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