Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Max Date from Unnormalized Table Expand / Collapse
Author
Message
Posted Thursday, January 10, 2013 6:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 14, 2013 2:40 PM
Points: 8, Visits: 59
Thanks Greg. Peter's solution is working for me, but I appreciate the input.

When I tried your method I got an error. I realize I'm using SQL Server 2008 SSMS but I'm connecting to a 2005 database. Perhaps that has something to do with it...

Msg 325, Level 15, State 1, Line 22
Incorrect syntax near 'UNPIVOT'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel.
Post #1405380
Posted Thursday, January 10, 2013 7:37 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, February 05, 2014 2:39 PM
Points: 1,564, Visits: 2,366
DevSteve (1/10/2013)
Thanks Greg. Peter's solution is working for me, but I appreciate the input.

When I tried your method I got an error. I realize I'm using SQL Server 2008 SSMS but I'm connecting to a 2005 database. Perhaps that has something to do with it...

Msg 325, Level 15, State 1, Line 22
Incorrect syntax near 'UNPIVOT'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel.



Ah, yes. I was about 20 minutes from walking out the door when I read your post yesterday, and did not read it closely enough. I did not realize you are on 2005, so you will have to stick with Peter's solution (which is better anyway). I just realized my solution neglects your last set of criteria anyway. I probably should not have posted it.


Greg
_________________________________________________________________________________________________
The glass is at one half capacity: nothing more, nothing less.
Post #1405450
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse