Time Queries :confused:

Good Looking Bloke

Registered User.
Local time
Tomorrow, 01:15
Joined
Oct 15, 2019
Messages
30
I have a real hard time with time...sometimes it works fine. Others, well not so much is a nice explanation for not at all rhyming with duck.

Todays challenge should anyone choose to accept it before I explode is the following:

Code:
SELECT qryVisitTime.TimeCut FROM qryVisitTime WHERE (((qryVisitTime.TimeCut) > #5:15:00 AM#  ORDER BY qryVisitTime.TimeCut;

This SQL is throwing an error something to do with the #5:15:00 AM#...which is really weird as this is fed from the identical query one step before.

The query above is based on qryVisitTime which looks like:

Code:
SELECT WeekdayName(Weekday([Visit Date])) AS Week_Day, qryA.[Visit Time], qryA.[Member ID], Month([Visit Date]) AS VisitMonth, TimeSerial(Hour([Visit time]),(Minute([Visit time])\15)*15,0) AS TimeCut
FROM qryA;

qryA is simply a holding query it doesnt do anything its instead of working on the raw table data...separation of concerns so to speak.
 
help to know what the error actually is but it looks like you have a surfeit of parentheses
 
Code:
WHERE (((qryVisitTime.TimeCut) > #5:15:00 AM#))

WHERE (((qryVisitTime.TimeCut)>#12/30/1899 5:15:0#))
 
Thanks. I just solved it.

SELECT qryVisitTime.TimeCut
FROM qryVisitTime
WHERE (((qryVisitTime.TimeCut)>#3:30:00 AM#));

Was the solution...

In code this is

"SELECT qryVisitTime.TimeCut " & _
"FROM qryVisitTime " & _
"WHERE (((qryVisitTime.TimeCut)>#" & cboIn "#));"

Pesky #
 

Users who are viewing this thread

Back
Top Bottom