Query Involving Days of the Week.

minii

Registered User.
Local time
Today, 10:34
Joined
Nov 8, 2010
Messages
26
So I'm trying to compare some days of the week. Basically I have a table that has a field called "DayRan" and this contains a day of the week monday, tuesday etc. Then what I'm trying to do is compare it in a query against todays date using Date() formatted as "dddd" so that I can see what runs today but it does not work. If I get the query just to display the results without comparing anything it will happily show the data but when I try to compare it doesn't display anything. Only thing I can think of is that it's strangely formatted from using Date()?

I have also tried doing this by changing instead doing "DayRan" as a number 0 = sunday, 1 = monday etc. and then instead comparing it to Weekday(date) and this also did not work :(

Any help appreciated. Thanks.
 
Your condition line should read as follows

= Format(Date(),"dddd")
 
I had tried that and just did again to double check, it's not returning anything.

EDIT: Scrap that, actually it's working now - I had missed something on my end. Many thanks.

EDIT2: Actually it works kind of... While it now displays Tuesday as I would expect. When I add other criteria to the query, in this case Tape and Overwritable (which is a yes no field) and put a criteria of only overwritable it then just returns all results with saying they are happening today when in the original table it's looking up from only one is scheduled for today. If that makes sense.

Resolved now, thanks DCrake.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom