Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
SELECT *FROM (SELECT M.MEMBER_ID, M.LAST_NAME, M.FIRST_NAME, S.QTY, S.DATE, ENSURE FROM (Schedule As S JOIN Members As M ON S.MEMBER_ID = M.MEMBER_ID)) psPIVOT(SUM (QTY) FOR DATE IN ([05/18/2009])) AS Q
However, what I need is to be able to define a range in the IN clause.Something like >=4/1/2009 and <=5/31/2009Any help will be greatly appreciated.
SwePeso
Patron Saint of Lost Yaks
30421 Posts
Posted - 2009-05-26 : 16:21:21
You will have to explicit write all dates to pivot for.This can be done dynamically. There are lot of examples of this here at SQLTeam.E 12°55'05.63"N 56°04'39.26"