G
Guest
Attached is my SQL. Any idea what I need to change for the order to sort by Carrier before Delivery Cost
Thanks
TRANSFORM Count(tblDeliveries.[Delivery ID]) AS T
SELECT tblDestinations.State, tblDestinations.City, tblDestinations.[Freight Goal] AS Goal, tblCarriers.[Carrier Code] AS Carrier, tblDeliveries.[Delivery Cost] AS Cos
FROM tblDestinations INNER JOIN (tblCarriers INNER JOIN tblDeliveries ON tblCarriers.[Carrier ID] = tblDeliveries.[Carrier ID]) ON tblDestinations.[Location ID] = tblDeliveries.[Location ID
WHERE (((tblDeliveries.[Delivery Date]) Between [Start Date] And [Ending Date])
GROUP BY Format(tblDeliveries.[Delivery Date],"yyyymm"), tblDestinations.State, tblDestinations.City, tblDestinations.[Freight Goal], tblCarriers.[Carrier Code], tblDeliveries.[Delivery Cost
ORDER BY tblDestinations.State, tblDestinations.Cit
PIVOT Format([Delivery Date],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
Thanks
TRANSFORM Count(tblDeliveries.[Delivery ID]) AS T
SELECT tblDestinations.State, tblDestinations.City, tblDestinations.[Freight Goal] AS Goal, tblCarriers.[Carrier Code] AS Carrier, tblDeliveries.[Delivery Cost] AS Cos
FROM tblDestinations INNER JOIN (tblCarriers INNER JOIN tblDeliveries ON tblCarriers.[Carrier ID] = tblDeliveries.[Carrier ID]) ON tblDestinations.[Location ID] = tblDeliveries.[Location ID
WHERE (((tblDeliveries.[Delivery Date]) Between [Start Date] And [Ending Date])
GROUP BY Format(tblDeliveries.[Delivery Date],"yyyymm"), tblDestinations.State, tblDestinations.City, tblDestinations.[Freight Goal], tblCarriers.[Carrier Code], tblDeliveries.[Delivery Cost
ORDER BY tblDestinations.State, tblDestinations.Cit
PIVOT Format([Delivery Date],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")