Extracting Day of Week from DateTime

J

JohnB

Hi.

If I have a field set to DateTime, is there an expression I can use in query
or an unbound text box which shows the relevant day. eg if I enter todays
date in the DateTime field (10-11-05), the expression would show Thursday.
All I seem to be able to do is show the day number (10).

Thanks for any help. John
 
R

Rick B

I think it is...

DayValue: Format([SomeField],"dddd")

Use the help files to look at the exact syntax of "format" or "datepart".
 
R

Rick Brandt

JohnB said:
Hi.

If I have a field set to DateTime, is there an expression I can use
in query or an unbound text box which shows the relevant day. eg if I
enter todays date in the DateTime field (10-11-05), the expression
would show Thursday. All I seem to be able to do is show the day
number (10).

Thanks for any help. John

Format() function =Format([DateFieldName], "dddd")

or use a format property of "dddd".
 
K

Klatuu

Depending on what verison of Access you are using, you could try:
=WeekDayName(WeekDay(Date))
 
J

JohnB

Thanks Rick That works perfectly. Cheers, JohnB

Rick Brandt said:
JohnB said:
Hi.

If I have a field set to DateTime, is there an expression I can use
in query or an unbound text box which shows the relevant day. eg if I
enter todays date in the DateTime field (10-11-05), the expression
would show Thursday. All I seem to be able to do is show the day
number (10).

Thanks for any help. John

Format() function =Format([DateFieldName], "dddd")

or use a format property of "dddd".
 
J

JohnB

Thanks. I've got it working. Cheers, JohnB

Rick B said:
I think it is...

DayValue: Format([SomeField],"dddd")

Use the help files to look at the exact syntax of "format" or "datepart".

--
Rick B



JohnB said:
Hi.

If I have a field set to DateTime, is there an expression I can use in
query
or an unbound text box which shows the relevant day. eg if I enter todays
date in the DateTime field (10-11-05), the expression would show Thursday.
All I seem to be able to do is show the day number (10).

Thanks for any help. John
 
J

JohnB

I'm sure this would have worked but I've already had success with Rick
Brandts suggestion. Thanks for the reply, JohnB
 
Top