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

Dateadd format question

Status
Not open for further replies.

Niko7

Programmer
Dec 30, 2002
6
US
In a query I have a date column "Time Out Door"... I need to sort in the report from 7:30 AM to 7:30 AM (spans across 2 days, but we consider it one day of 3 shifts). The following will sort from 7AM to 7AM, but I do not know how to change the format to 7:30. I have tried 7.5 and 7:30 and "m", -450 (7.5*60 minutes)... none worked!

DateAdd("h",-7,IIf(DatePart("d",DateAdd("h",-7,[Time out Door]))=29,DateAdd("d",1,[Time out Door]),[Time out Door]))

Thank you!
 
"m" is used for month, "n" is minute.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top