Time Queries :confused: (1 Viewer)

Good Looking Bloke

Registered User.
Local time
Tomorrow, 04:58
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.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 21:58
Joined
Feb 19, 2013
Messages
16,600
help to know what the error actually is but it looks like you have a surfeit of parentheses
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:58
Joined
May 7, 2009
Messages
19,227
Code:
WHERE (((qryVisitTime.TimeCut) > #5:15:00 AM#))

WHERE (((qryVisitTime.TimeCut)>#12/30/1899 5:15:0#))
 

Good Looking Bloke

Registered User.
Local time
Tomorrow, 04:58
Joined
Oct 15, 2019
Messages
30
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

Top Bottom