Link to home
Start Free TrialLog in
Avatar of koossa
koossa

asked on

TRANSFORM Access query in SQL Server?

I have this old MS Access query that I need to rewrite for SQL Server.

TRANSFORM Last(MyTable.Desc) AS LastOfDesc SELECT MyTable.Name FROM MyTable WHERE (((MyTable.Name)<>'') AND (Datediff(day,[Date],'2011-01-01')>=lTimeFrame * -1) And (Datediff(day,[Date],'2011-01-01') <=lTimeFrame) GROUP BY MyTable.Name ORDER BY MyTable.Name PIVOT Year([Date]) & chr(13) & Month([Date]) & chr(13) & Day([Date]));

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of spikelly
spikelly
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of koossa
koossa

ASKER

This is just to pickup anomalies if there happened to be a lot of the same descriptions in a time frame.
So I think I could use anything else in the place of Last(
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of koossa

ASKER

Thank you