I have a union statement that displays in listbox... Its a shipping database. The below statement works fine.. Grabs all data it needs to & displays the data as the events are to happen... Goes into the future 20 days and the past 60 days. I have two combo boxes on the form with the list.
Sort By Job Manager & Sort By Tracking Group. Those Combo Boxes have the names of all current users/groups & then have a "ALL Users" or ALL Groups at the top.
I Need to be able to add this to my below union... I had tried putting:
((ExpRecords.[Job Manager])=IIf([Forms]![ExpOutBoundManager]![ExpOBMQueryManagerCmbo]='All Users',' ',[ExpRecords]![Job Manager]=[Forms]![ExpOutBoundManager]![ExpOBMQueryManagerCmbo]))
That doesnt work. I need to add IF the Combobox = ALL USERS then query as is... for all users, if not then Query using the Specific user selected.
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, "Sail On Board" & " " & [ExpBooking]![VesselName] & " " & [ExpBooking]![VesselVoy] AS [Event Description], ExpBooking.DateOfDeparture AS [Date], [ExpBooking]![DateOfDeparture]-Date() AS Days, IIf([SailedConfirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.DateOfDeparture)<Date()+20 And (ExpBooking.DateOfDeparture)>Date()-60))[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION [/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, "Arrive Final Discharge Port" & " " & [ExpBooking]![VesselName] & " " & [ExpBooking]![VesselVoy] AS [Event Description], ExpBooking.[DateOfArrival] AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([FinalArriveConfirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.[DateOfArrival])<Date()+20 And (ExpBooking.[DateOfArrival])>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, "Arrive Final OnCarriage Point" & " " & [ExpBooking]![VesselName] & " " & [ExpBooking]![VesselVoy] AS [Event Description], ExpBooking.OnCarriageDate AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([DateOfArrival],"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC [/FONT]
[FONT="]WHERE (((ExpBooking.OnCarriageDate)<Date()+20 And (ExpBooking.OnCarriageDate)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC[/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment1Event AS [Event Description], ExpBooking.Transhipment1Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([Transhipment1Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment1Date)<Date()+20 And (ExpBooking.Transhipment1Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment2Event AS [Event Description], ExpBooking.Transhipment2Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([Transhipment2Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment2Date)<Date()+20 And (ExpBooking.Transhipment2Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment3Event AS [Event Description], ExpBooking.Transhipment3Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([Transhipment3Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment3Date)<Date()+20 And (ExpBooking.Transhipment3Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment4Event AS [Event Description], ExpBooking.Transhipment4Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment4Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment4Date)<Date()+20 And (ExpBooking.Transhipment4Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment5Event AS [Event Description], ExpBooking.Transhipment5Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment5Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment5Date)<Date()+20 And (ExpBooking.Transhipment5Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="]UNION [/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment6Event AS [Event Description], ExpBooking.Transhipment6Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment6Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment6Date)<Date()+20 And (ExpBooking.Transhipment6Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="]UNION [/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment7Event AS [Event Description], ExpBooking.Transhipment7Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment7Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment7Date)<Date()+20 And (ExpBooking.Transhipment7Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="]UNION [/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment8Event AS [Event Description], ExpBooking.Transhipment8Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment8Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment8Date)<Date()+20 And (ExpBooking.Transhipment8Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
Sort By Job Manager & Sort By Tracking Group. Those Combo Boxes have the names of all current users/groups & then have a "ALL Users" or ALL Groups at the top.
I Need to be able to add this to my below union... I had tried putting:
((ExpRecords.[Job Manager])=IIf([Forms]![ExpOutBoundManager]![ExpOBMQueryManagerCmbo]='All Users',' ',[ExpRecords]![Job Manager]=[Forms]![ExpOutBoundManager]![ExpOBMQueryManagerCmbo]))
That doesnt work. I need to add IF the Combobox = ALL USERS then query as is... for all users, if not then Query using the Specific user selected.
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, "Sail On Board" & " " & [ExpBooking]![VesselName] & " " & [ExpBooking]![VesselVoy] AS [Event Description], ExpBooking.DateOfDeparture AS [Date], [ExpBooking]![DateOfDeparture]-Date() AS Days, IIf([SailedConfirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.DateOfDeparture)<Date()+20 And (ExpBooking.DateOfDeparture)>Date()-60))[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION [/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, "Arrive Final Discharge Port" & " " & [ExpBooking]![VesselName] & " " & [ExpBooking]![VesselVoy] AS [Event Description], ExpBooking.[DateOfArrival] AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([FinalArriveConfirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.[DateOfArrival])<Date()+20 And (ExpBooking.[DateOfArrival])>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, "Arrive Final OnCarriage Point" & " " & [ExpBooking]![VesselName] & " " & [ExpBooking]![VesselVoy] AS [Event Description], ExpBooking.OnCarriageDate AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([DateOfArrival],"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC [/FONT]
[FONT="]WHERE (((ExpBooking.OnCarriageDate)<Date()+20 And (ExpBooking.OnCarriageDate)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC[/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment1Event AS [Event Description], ExpBooking.Transhipment1Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([Transhipment1Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment1Date)<Date()+20 And (ExpBooking.Transhipment1Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment2Event AS [Event Description], ExpBooking.Transhipment2Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([Transhipment2Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment2Date)<Date()+20 And (ExpBooking.Transhipment2Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment3Event AS [Event Description], ExpBooking.Transhipment3Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days,IIf([Transhipment3Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment3Date)<Date()+20 And (ExpBooking.Transhipment3Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment4Event AS [Event Description], ExpBooking.Transhipment4Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment4Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment4Date)<Date()+20 And (ExpBooking.Transhipment4Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="]UNION[/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment5Event AS [Event Description], ExpBooking.Transhipment5Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment5Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment5Date)<Date()+20 And (ExpBooking.Transhipment5Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="]UNION [/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment6Event AS [Event Description], ExpBooking.Transhipment6Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment6Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment6Date)<Date()+20 And (ExpBooking.Transhipment6Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="]UNION [/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment7Event AS [Event Description], ExpBooking.Transhipment7Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment7Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment7Date)<Date()+20 And (ExpBooking.Transhipment7Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]
[FONT="] [/FONT]
[FONT="]UNION [/FONT]
[FONT="] [/FONT]
[FONT="]SELECT ExpRecords.AEC, ExpRecords.Shipper, ExpBooking.NvoccCarrier AS Carrier, ExpBooking.UltimateCarrier AS Line, [ExpBooking].[QuantityOfEquip] & " x " & [ExpBooking].[EquipmentType] AS Equipment, ExpBooking.Transhipment8Event AS [Event Description], ExpBooking.Transhipment8Date AS [Date], [ExpBooking]![DateOfArrival]-Date() AS Days, IIf([Transhipment8Confirm]=-1,"Yes","No") AS Confirm[/FONT]
[FONT="]FROM (ExpRecords INNER JOIN ExpBooking ON ExpRecords.AEC = ExpBooking.AEC) INNER JOIN ExpDockRec ON ExpRecords.AEC = ExpDockRec.AEC[/FONT]
[FONT="]WHERE (((ExpBooking.Transhipment8Date)<Date()+20 And (ExpBooking.Transhipment8Date)>Date()-60))[/FONT]
[FONT="]ORDER BY Days DESC;[/FONT]