Hello,
please consider the following procedure:
SELECT SelDate, TotalAA, TotalAG
FROM (SELECT TOP 20 SelDate, TotalAA, TotalAG
FROM History
WHERE (UserId = @UserId)
ORDER BY Datum DESC) AS derivedtbl
ORDER BY SelDate
'SelDate' is a date (string) in yyyymmdd format. I would like to select a distinct month. Any suggestions?
Thanks in advance,
steve