Weekdays

User avatar
Graeme
Cosmic Lounger
Posts: 1230
Joined: 11 Feb 2010, 12:23
Location: Medway, Kent, UK

Weekdays

Post by Graeme »

Morning all

My database records shifts worked. A query includes the following calculated field:

Weekday: Weekday([ShiftDate])

This returns a number representing the day of the week as a function of the shift date.

Could someone point me in the right direction to convert the integer into a day of the week text please?

Thanks

Regards

Graeme
_______________________________________

http://www.averywayobservatory.co.uk/

User avatar
HansV
Administrator
Posts: 78493
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Weekdays

Post by HansV »

You could use

DOW: Format([ShiftDate],"ddd")

if you want to return Mon, Tue, Wed etc., or

DOW: Format([ShiftDate],"dddd")

if you want to return Monday, Tuesday, Wednesday etc.

Alternatively, you can use

DOW: WeekdayName([Weekday],True)

for Mon, Tue, Wed etc., or

DOW: WeekdayName([Weekday],False)

for Monday, Tuesday, Wednesday etc.
Best wishes,
Hans

User avatar
Graeme
Cosmic Lounger
Posts: 1230
Joined: 11 Feb 2010, 12:23
Location: Medway, Kent, UK

Re: Weekdays

Post by Graeme »

Thanks Hans, that's perfect.

I'll go and knock out my report now.

Regards

Graeme
_______________________________________

http://www.averywayobservatory.co.uk/