T
trevorC via AccessMonster.com
Hi All, the query below shows an error if any of the date in / date out
entries in the table are empty.
How can i impiment the Nz function to stop this.
SQL from query...
SELECT Employees.[First Name], Employees.[Last Name], Format([Normal start
Time],"h:nn AMPM") AS ['Normal Start Time], Format([Normal End Time],"h:nn
AMPM") AS ['Normal End Time], Format([scan time in],"h:nn AMPM") AS ['Scan
Time In], Format([scan time Out],"h:mm AMPM") AS ['Scan Time Out], Format(
[Scan Date In],"dddd dd,mm,yyyy") AS ['Scan Date In], Format([Scan Date Out],
"dddd dd,mm,yyyy") AS ['Scan Date Out], Format([Scan Time Out]-[Scan Time in],
"h:nn") AS [Total Hours], Format([Scan Time Out]-[Scan Time in],"h") AS Hours,
Format([Scan Time Out]-[Scan Time in],"nn") AS minutes, (([hours])*60)+nz(
[minutes]) AS [Total Minutes]
FROM Employees RIGHT JOIN [Time Tracking] ON Employees.Barcode = [Time
Tracking].[Employee ID]
ORDER BY Employees.[Last Name], [Time Tracking].[Scan Date Out];
This is the line that causes the error, were & how do i incorporate the Nz
function into it.
(([hours])*60)+nz([minutes])
The formatting in the query is so that i can export directly to Excel and the
fields are ready to see formatted and perform other calculations from there.
Any help would be great thanks.
entries in the table are empty.
How can i impiment the Nz function to stop this.
SQL from query...
SELECT Employees.[First Name], Employees.[Last Name], Format([Normal start
Time],"h:nn AMPM") AS ['Normal Start Time], Format([Normal End Time],"h:nn
AMPM") AS ['Normal End Time], Format([scan time in],"h:nn AMPM") AS ['Scan
Time In], Format([scan time Out],"h:mm AMPM") AS ['Scan Time Out], Format(
[Scan Date In],"dddd dd,mm,yyyy") AS ['Scan Date In], Format([Scan Date Out],
"dddd dd,mm,yyyy") AS ['Scan Date Out], Format([Scan Time Out]-[Scan Time in],
"h:nn") AS [Total Hours], Format([Scan Time Out]-[Scan Time in],"h") AS Hours,
Format([Scan Time Out]-[Scan Time in],"nn") AS minutes, (([hours])*60)+nz(
[minutes]) AS [Total Minutes]
FROM Employees RIGHT JOIN [Time Tracking] ON Employees.Barcode = [Time
Tracking].[Employee ID]
ORDER BY Employees.[Last Name], [Time Tracking].[Scan Date Out];
This is the line that causes the error, were & how do i incorporate the Nz
function into it.
(([hours])*60)+nz([minutes])
The formatting in the query is so that i can export directly to Excel and the
fields are ready to see formatted and perform other calculations from there.
Any help would be great thanks.