TheSearcher
Registered User.
- Local time
- Today, 11:54
- Joined
- Jul 21, 2011
- Messages
- 398
My table looks like this. Start_Time and End_Time are both Date/Time fields set to a Long Time format.
The data in my table looks like this.
In Query Design the query looks like this:
But in SQL View it looks like this:
When I include a format function in the query the date part still remains:
The query should return one record but it doesn't return anything.
Can someone please explain to me what I'm doing wrong?
ManyThanks,
TS
The data in my table looks like this.
| Therapist | TheDate | Start_Time | End_Time | Client_Name | Client_Id | UID |
| Jane Smith | 10/28/2025 | 8:30:00 AM | 9:30:00 AM | Debbie Jones | 600123 | 560 |
In Query Design the query looks like this:
But in SQL View it looks like this:
Code:
SELECT tbl_Schedule.Client_Id, tbl_Schedule.TheDate, tbl_Schedule.Start_Time, tbl_Schedule.End_Time
FROM tbl_Schedule
WHERE (((tbl_Schedule.Client_Id)='600123') AND ((tbl_Schedule.TheDate)=#10/28/2025#) AND ((tbl_Schedule.Start_Time)<=#12/30/1899 8:30:0#) AND ((tbl_Schedule.End_Time)>#12/30/1899 9:30:0#));
When I include a format function in the query the date part still remains:
Code:
SELECT tbl_Schedule.Client_Id, tbl_Schedule.TheDate, tbl_Schedule.Start_Time, tbl_Schedule.End_Time
FROM tbl_Schedule
WHERE (((tbl_Schedule.Client_Id)='600123') AND ((tbl_Schedule.TheDate)=#10/28/2025#) AND ((tbl_Schedule.Start_Time)<=Format(#12/30/1899 8:30:0#,"hh:nn:ss AM/PM")) AND ((tbl_Schedule.End_Time)>Format(#12/30/1899 9:30:0#,"hh:nn:ss AM/PM")));
The query should return one record but it doesn't return anything.
Can someone please explain to me what I'm doing wrong?
ManyThanks,
TS