I'm working with a access database that has a table in sql. so in my module when I'm trying to run an sql statement to get records from my sql table("seesions"
I have to use this sql statment-because of the differences in the time fields between access/sql-the cvDate format
sqll = "Select OSIS, STime, DateOfService FROM qrySessionsOverlaps Where [OSIS] = '" & StudentID & "'" & _
" And DateOfService = #" & DATE1 & "# And ((#" & CVDate(Format(BeginTime, "hh:nn AM/PM"
) & "# <= #" & [STime] & "# And #" & _
CVDate(Format(EndTime, "hh:nn AM/PM"
) & "# > " & [STime] & " Or (# " & _
CVDate(Format(BeginTime, "hh:nn AM/PM"
) & "# >=" & [STime] & " And #" & CVDate(Format(BeginTime, "hh:nn AM/PM"
) & "# < " & [STime] & " ))"
and the qrySesssionsOverlaps contains this:
SELECT Sessions.OSIS, Sessions.EmployeeID, Sessions.DateOfService, Sessions.WereServiceRendered, CVDate(Format([TimeSessionStarted],"hh:nn:ss AM/PM"
) AS STime, Sessions.ErrorCodes
FROM Sessions
WHERE (((Sessions.WereServiceRendered)="Y"
AND ((Sessions.ErrorCodes) Is Null Or (Sessions.ErrorCodes)<>"del"
);
now, the problem is that the code in the module (the first code that I posted doesn't return anything for STime-it stays empty-even though I converted it to the right format in the qryOverlapsSessions query
any ideas why?
sqll = "Select OSIS, STime, DateOfService FROM qrySessionsOverlaps Where [OSIS] = '" & StudentID & "'" & _
" And DateOfService = #" & DATE1 & "# And ((#" & CVDate(Format(BeginTime, "hh:nn AM/PM"
CVDate(Format(EndTime, "hh:nn AM/PM"
CVDate(Format(BeginTime, "hh:nn AM/PM"
and the qrySesssionsOverlaps contains this:
SELECT Sessions.OSIS, Sessions.EmployeeID, Sessions.DateOfService, Sessions.WereServiceRendered, CVDate(Format([TimeSessionStarted],"hh:nn:ss AM/PM"
FROM Sessions
WHERE (((Sessions.WereServiceRendered)="Y"
now, the problem is that the code in the module (the first code that I posted doesn't return anything for STime-it stays empty-even though I converted it to the right format in the qryOverlapsSessions query
any ideas why?