Extracting Day of Week from DateTime

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
I think it is...

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

Use the help files to look at the exact syntax of "format" or "datepart".
 
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".
 
Depending on what verison of Access you are using, you could try:
=WeekDayName(WeekDay(Date))
 
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".
 
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
 
I'm sure this would have worked but I've already had success with Rick
Brandts suggestion. Thanks for the reply, JohnB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top