Query and filtering dates

  • Thread starter Thread starter robert
  • Start date Start date
R

robert

I have a date field named dateFIELD in my database whose output or
display is a LONG DATE and the input mask is a SHORT DATE:

I type: 08/31/2006
Access enters: Thursday, August 31, 2006

In a query if I type Day([dateFIELD]) i get 31, what is the formula to
return Saturday, instead of 31? Or is there a formula to return the
actual name of the day rather than the number of the day?

Thanks in advance.
 
It might be better to use:
Format([dateFIELD], "dddd")
since that works in all versions of Access, and with all regional settings.

WeekdayName() has several problems:
- fails in Access 97 and earlier,
- unreliable in Access 2000, and
- gives wrong results in some regional settings.

Details:
http://allenbrowne.com/ser-36.html#WeekdayName

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

CompGeek78 said:
Use weekdayname(weekday([dateFIELD]))

Keven
I have a date field named dateFIELD in my database whose output or
display is a LONG DATE and the input mask is a SHORT DATE:

I type: 08/31/2006
Access enters: Thursday, August 31, 2006

In a query if I type Day([dateFIELD]) i get 31, what is the formula to
return Saturday, instead of 31? Or is there a formula to return the
actual name of the day rather than the number of the day?

Thanks in advance.
 
Crazy, I've never seen issues with the WeekdayName function before, but
after reading your article and trying some of those things out...I'm
amazed. Thanks for the correction, I'll stop using the weekdayname
function.

Allen said:
It might be better to use:
Format([dateFIELD], "dddd")
since that works in all versions of Access, and with all regional settings.

WeekdayName() has several problems:
- fails in Access 97 and earlier,
- unreliable in Access 2000, and
- gives wrong results in some regional settings.

Details:
http://allenbrowne.com/ser-36.html#WeekdayName

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

CompGeek78 said:
Use weekdayname(weekday([dateFIELD]))

Keven
I have a date field named dateFIELD in my database whose output or
display is a LONG DATE and the input mask is a SHORT DATE:

I type: 08/31/2006
Access enters: Thursday, August 31, 2006

In a query if I type Day([dateFIELD]) i get 31, what is the formula to
return Saturday, instead of 31? Or is there a formula to return the
actual name of the day rather than the number of the day?

Thanks in advance.
 
You guys are the greatest! Thanks for the code, now I have to remember
where I needed to use it?!!!!!!

Thanks!
Rob
 

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

Similar Threads

Date Diff Issue 4
Excel Colour code dates 1
Dlookup 7
query using an expression 7
Previous Month Date Function 5
Smart Filter For My Query 1
The DATE debate 0
Input Mask for Date 2

Back
Top