Query showing #error in field

mkelly

Registered User.
Local time
Yesterday, 20:27
Joined
Apr 10, 2002
Messages
213
Can you please review the sample db abd let me know why my field "shorttime dup1 is returning and error if the coressponding field are blank and possibly how to fix it?

thanks
 

Attachments

The #Errors are caused by using CDate() on null values. You can change it to:-

IIf(IsNull([dup1s]) or IsNull([dup1f]),Null,Int([dup1f]-[dup1s]-CDate("0:0:" & DatePart("s",[dup1f]-[dup1s])))*24+DatePart("h",[dup1f]-[dup1s]-CDate("0:0:" & DatePart("s",[dup1f]-[dup1s]))) & Format([dup1f]-[dup1s]-CDate("0:0:" & DatePart("s",[dup1f]-[dup1s])),":nn")) AS [shorttime dup1]
 
Last edited:

Users who are viewing this thread

Back
Top Bottom