It is giving my the last record in January (which is on the 31st) but Feb. has only partial data. And I expect to see something listed on Feb 9th (as there was no data for the rest of Feb)
so what I want is: for the entire year 12 rows (corresponding to last entered infromation for each month)
Is there a way to fix that
here is the code as is:
SELECT ladder_date, BOM, NAV, gMTDRT, gMTDPER
FROM dailySummary
WHERE [ladder_date]=DateSerial(Year([ladder_date]),1+Month([ladder_date]),0);
SELECT A.ladder_date, A.BOM, A.NAV, A.gMTDRT, A.gMTDPER
FROM dailySummary AS A INNER JOIN (
SELECT Month([ladder_date]), MAX([ladder_date]) AS LastDay FROM dailySummary GROUP BY Month([ladder_date])
) AS L ON A.ladder_date = L.LastDay
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
SELECT A.ladder_date, A.BOM, A.NAV, A.gMTDRT, A.gMTDPER
FROM dailySummary AS A INNER JOIN (
SELECT Format([ladder_date],'yyyymm'), MAX([ladder_date]) AS LastDay FROM dailySummary GROUP BY Format([ladder_date],'yyyymm')
) AS L ON A.ladder_date = L.LastDay
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.