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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date question in MS Access 2

Status
Not open for further replies.

herd

Technical User
Jun 23, 2003
46
US
If I have two date fields (Date1 and Date2) how would I get a date3 that's between date1 and date2?

Thanks Gary
 
There may be other ways but

DateAdd("d",(DateDiff("d",Date1,Date2)/2),Date1)

is one way

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Or simply this:
Date3 = Date1 + (Date2 - Date1) / 2

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
When I put both of these codes into my date3 field I get a return of #Name?............what am I doing wrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top