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

Day/date functions

Status
Not open for further replies.

tonyflavell

Programmer
Jul 21, 2001
119
GB
If a query for a report returns "Friday" in a field, can someone tell me how do get it to display the day before in the report printout. ie "Thursday" or "Wednesday" in the query shows as "Tuesday" in the report.
 
If this is Access, I find I need to specify first day of week as vbSunday.
 

WeekDayName(Weekday(CDate(TheDate)-1))

Or

DatePart("w",CDate(TheDate)-1,vbSunday)
where the return value is the day of the week starting with the 1 vbSunday. If you use another value for FirstDayOfWeek then, such as vbMonday, then that equals 1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top