Hi I have formulated a UNION query to give me a result set which is filtered using a the Asset field on a form called Reserve. I need to put the dates into "dd/mm/yyyy" format as some are Date & Time hence the format parts.
I am not great at converting query SQl to VBA code......can anyone let me have the correct coding to convert this to the correct code for my VBA.....
Hoping one of you coding guru's can help!!!!
Cheers
I am not great at converting query SQl to VBA code......can anyone let me have the correct coding to convert this to the correct code for my VBA.....
Code:
SELECT Reservations.[Job Number], Reservations.Asset, Left([First Name],1) & Left([Last Name],1) AS Initials, Format([Checked Out Date],"dd/mm/yyyy") AS FCheckOut, IIf([Checked In Date] Is Null,Format([Due Date],"dd/mm/yyyy"),Format([Checked In Date],"dd/mm/yyyy")) AS FInDate
FROM Reservations LEFT JOIN Contacts ON Reservations.[Checked Out To] = Contacts.ID
WHERE (((Reservations.Asset)=[Forms]![Reserve]![Asset]))
UNION ALL SELECT Transactions.[Job Number], Transactions.Asset, Left([First Name],1) & Left([Last Name],1) AS Initials, Format([Checked Out Date],"dd/mm/yyyy") AS FCheckOut, IIf([Checked In Date] Is Null,Format([Due Date],"dd/mm/yyyy"),Format([Checked In Date],"dd/mm/yyyy")) AS FInDate
FROM Transactions LEFT JOIN Contacts ON Transactions.[Checked Out To] = Contacts.ID
WHERE (((Transactions.Asset)=[Forms]![Reserve]![Asset]));
Hoping one of you coding guru's can help!!!!
Cheers