Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating the difference between 2 dates in query

Status
Not open for further replies.

LDG1234

Programmer
Jun 26, 2001
120
GB
Can anyone tell me how to calculate the number of days between 2 dates?

The problem I have is that the first date is in long format, dd/mm/yy hh:mm:ss and the second in short format, dd/mm/yy.

Any ideas?

Many thanks

Lloyd Lloyd Gozzett
Process Developer
 
DateDiff("d", DateOne, DateTwo)
MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Or, taking Michael's DateDiff function, you could also create a new column, DiffOfDates, with the result by entering the following:

DiffOfDates:DateDiff("d", DateOne, DateTwo)

Steve King Growth follows a healthy professional curiosity
 
Hi Friends,

When the "date" is left blank under the format "short date", Access will give the first day of the month automatically. Is there a way to program "short date" so that when the date field is blank, I can leave it blank? or best use a code, say "99"?

Thanks,
Beanie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top