I have a DATEPART question. In the below statement I would only like to view the current year and have roll into next year without having to change the below statement each year.
Where and what do I insert to have the below query output the current year?
SELECT DISTINCTROW [SHIP INFO].Unit, Format$([PORT VISIT].[ARRIVAL_DATE],'\Qq yyyy') AS [ARRIVAL_DATE By Quarter], First([PORT VISIT].PORT_LOCATION) AS [First Of PORT_LOCATION]
FROM [SHIP INFO] LEFT JOIN [PORT VISIT] ON [SHIP INFO].[Record No] = [PORT VISIT].[Record No]
GROUP BY [SHIP INFO].Unit, Format$([PORT VISIT].[ARRIVAL_DATE],'\Qq yyyy'), Year([PORT VISIT].[ARRIVAL_DATE])*4+DatePart('q',[PORT VISIT].[ARRIVAL_DATE])-1;
Chuck
Where and what do I insert to have the below query output the current year?
SELECT DISTINCTROW [SHIP INFO].Unit, Format$([PORT VISIT].[ARRIVAL_DATE],'\Qq yyyy') AS [ARRIVAL_DATE By Quarter], First([PORT VISIT].PORT_LOCATION) AS [First Of PORT_LOCATION]
FROM [SHIP INFO] LEFT JOIN [PORT VISIT] ON [SHIP INFO].[Record No] = [PORT VISIT].[Record No]
GROUP BY [SHIP INFO].Unit, Format$([PORT VISIT].[ARRIVAL_DATE],'\Qq yyyy'), Year([PORT VISIT].[ARRIVAL_DATE])*4+DatePart('q',[PORT VISIT].[ARRIVAL_DATE])-1;
Chuck