Code:
SELECT Importer.[Importer Name], Purchasing.vessel, Purchasing.[Arrival Date], Purchasing.[Fuel Type], Purchasing.quantity, Year([Arrival Date]) AS [Year], Month([Arrival Date]) AS [Month], DatePart("q",[Arrival Date]) AS Quarter, Format([Arrival Date],"mmmm") AS [Month Name], (Month([Arrival Date]) Mod 3) AS MonthOfQuarter
FROM Importer INNER JOIN Purchasing ON Importer.ImporterID = Purchasing.ImporterID;
Code:
SELECT [Payment Extended].PaymentID, Importer.[Importer Name], [Payment Extended].[Receipt NO], [Payment Extended].[Date Paid], [Payment Extended].Revenue, Year([Date Paid]) AS [Year], Month([Date Paid]) AS [Month], DatePart("q",[Date Paid]) AS Quarter, (Month([Date Paid]) Mod 3) AS MonthOfQuarter, Format([Date Paid],"mmmm") AS [Month Name]
FROM [Payment Extended] LEFT JOIN Importer ON [Payment Extended].[ImporterID] = Importer.[ImporterID];
These the 2 queries the first one is the quantity and the second is revenue the quantity is on arrival date and the revenue is on payment date.
Thanks