M
Marianne
I have a union query:
SELECT Service_Plan_ID, Format(Start_Time,"h:mm") as Start,
Format(End_Time,"h:mm") as End, ServDate, InvNo, Recnum, "" as Qty, "" as
Rate, Sleepover, "" as Description,Verified, ShadShift
FROM tblService_Date_and_Times
UNION ALL SELECT ServiceNo as Service_Plan_ID, "" as Start, "" as End,
ServDate, InvNo, Recnum, Qty, Rate, False as Sleepover, Description, True as
Verified, False as ShadShift
FROM tblMiscInvoicing;
This union query is in another query where I use the following formula to
calculate the hours
Hrs: IIf([Start]="",[Qty],IIf([Sleepover]=True Or
[Start]=[End],0,IIf([Start]>[End],(([End]-[Start])*24)+24,([End]-[Start])*24)))
I get the error when I run the query. If I try to sort on the field I get
the following message:
Data type mismatch in criteria expression
Anyone with any ideas?
SELECT Service_Plan_ID, Format(Start_Time,"h:mm") as Start,
Format(End_Time,"h:mm") as End, ServDate, InvNo, Recnum, "" as Qty, "" as
Rate, Sleepover, "" as Description,Verified, ShadShift
FROM tblService_Date_and_Times
UNION ALL SELECT ServiceNo as Service_Plan_ID, "" as Start, "" as End,
ServDate, InvNo, Recnum, Qty, Rate, False as Sleepover, Description, True as
Verified, False as ShadShift
FROM tblMiscInvoicing;
This union query is in another query where I use the following formula to
calculate the hours
Hrs: IIf([Start]="",[Qty],IIf([Sleepover]=True Or
[Start]=[End],0,IIf([Start]>[End],(([End]-[Start])*24)+24,([End]-[Start])*24)))
I get the error when I run the query. If I try to sort on the field I get
the following message:
Data type mismatch in criteria expression
Anyone with any ideas?