Hi,
I wrote an SQL Union query that will return a list of time slots joined with appointments which will be sent to a combo box on an Access 2007 form, basically for a scheduling form. The time slots are stored as the Time datatype in mysql, but when the query is returned in access, it gets automatically formatted with today's date in front of the times. When I try to run the SQL query in my MySQL front end, it works fine, so I'm guessing it is an Access issue. I'm kind of stumped at the moment as I am still quite inexperienced with SQL and MySQL.
Here is the code:
SELECT tbltime_slots.Time_Slot, '' AS Name
FROM tbltime_slots
WHERE Surgery_Day = 18
UNION
SELECT TIME(tblschedule.Surgery_Time), CONCAT(Last_Name, ', ', First_Name)
FROM tblschedule LEFT JOIN tblpatients ON tblschedule.PatientID = tblpatients.PatientID
WHERE (((tblschedule.Surgery_Date)= 18)) and (((tblschedule.SurgeonID)=2));
OH and the WHERE parts are done by pulling values in VBA, these are just dummy values.
Thank you!
Avi
I wrote an SQL Union query that will return a list of time slots joined with appointments which will be sent to a combo box on an Access 2007 form, basically for a scheduling form. The time slots are stored as the Time datatype in mysql, but when the query is returned in access, it gets automatically formatted with today's date in front of the times. When I try to run the SQL query in my MySQL front end, it works fine, so I'm guessing it is an Access issue. I'm kind of stumped at the moment as I am still quite inexperienced with SQL and MySQL.
Here is the code:
SELECT tbltime_slots.Time_Slot, '' AS Name
FROM tbltime_slots
WHERE Surgery_Day = 18
UNION
SELECT TIME(tblschedule.Surgery_Time), CONCAT(Last_Name, ', ', First_Name)
FROM tblschedule LEFT JOIN tblpatients ON tblschedule.PatientID = tblpatients.PatientID
WHERE (((tblschedule.Surgery_Date)= 18)) and (((tblschedule.SurgeonID)=2));
OH and the WHERE parts are done by pulling values in VBA, these are just dummy values.
Thank you!
Avi