Sorry for being unclear. I want my query to sort by Month then by Day. For example
Mon Day
08 Monday
08 Tuesday
08 Wednesday
08 Thurs
etc
BUT, my query is soring like this
Mon Day
08 Friday
08 Monday
08 Thursday
08 Tuesday
etc
(I excluded Sat and Sun if you're wondering)
I want to sort my query by Month then by Day. I have month sorted 01, 02, 03, etc. Although my days are listed as Monday, Tuesday, Wed... So when I sort it'll sort in alpha order. Friday, Monday... This is my field Day: Format([Date],'dddd')
What is the best way to get it to sort in the...
Brian I also used your Count metod...
Count22-06:sum(iif(hour(datefield) IN(22,23,00,1,2,3,4,5),1,0)
Count06-10:sum(iif(hour(datefield) IN(6,7,8,9),1,0)
and it worked fine as well. thanks!
Namlian, thanks for looking out for me, but this is just a one time report. My boss just wants to compare these times with workers for a quick business decision. Nothing long term! promise! and I really have no clue how to fix that expression lol.
namliam,
your help has been amazing. I'm trying to do it the IIF way
iif(IngateStartDT >= 22 or Hour(now()+6/24) < 6, "22-06",
iif(IngateStartDT<10, "06-10",
iif(IngateStartDT<19, "10-19", "19-22")))
although my results will only show the 22-06
Here is my query
SELECT...
Ok the time criteria was the issue. I switched the 10:00 and 6:00 positions and the query worked... but the data is incorrect because it pulls less than 6:00 and more than 10:00, it wont work as more than 6 and less than 10... why is that??
Brian this is what I have ...
SELECT DISTINCT Format([IngateStartDT],'mmmm') AS Mon, Format([IngateStartDT],'dddd') AS [Day],
Sum(IIf(Format([IngateStartDT],"hh:nn:ss")<#12/30/1899 10:0:0# And Format([IngateStartDT],"hh:nn:ss")>=#12/30/1899 6:0:0#,1,0)) AS CountId,
Count(*) AS Expr1
FROM [T...
Brian, I got your code to work, but I changed it to this. Would this work, because the Counts I'm getting look very incorrect...
Expr1: Count(IIf(Format([IngateStartDT],"hh:nn:ss")<#10:00:00 AM# And Format([IngateStartDT],"hh:nn:ss")>=#6:00:00 AM#,1,0))
namliam, thankyou thankyou very much for your help. I tried your expression and had the hour ranges of 1-5, 11-15, 16-20, 21-25, 6-10. I need 6-10, 10-19, 19-22, 22-6. Is this possible since the time intervals aren't exactly at a constant increase?
Brian thanks for the help... your function gave me an error of invalid syntax
One more thing I just noticed Saturday and Sunday have different times than Mon - Fri. for Sat and Sun the times are 6am - 2pm; 2pm - 10pm; 10pm-6am
thankyou thankyou very much for your help. I tried your expression and had the hour ranges of 1-5, 11-15, 16-20, 21-25, 6-10. I need 6-10, 10-19, 19-22, 22-6
i believe i need an iif... so like ill have a field with the criteria between '7/1/2007 and 12/31/2007' and another field with some time of iif between 6am - 10am count that field? correct? little help with the code please!!
I have to run a query where the criteria is specific time ranges. The column is formatted as date/time (ie. 7/12/2008 06:28:02). I need the criteria to give me data for specific time ranges on each individual day for a year. So for the data set of 7/01/2007-12/31/2007 I need the specific data...
i know content>style
but there was a story my old programming teacher told me. she got a job to "fix" a program made by another individual, because the company said the program didn't work correctly. my teacher reviewed everything and said the code was extremely great and the only thing she...