On 5/24/2012 11:48 AM, Stephen Russell wrote: > Views are to set in place the obnoxious code you don't want to retype > like below: > > > SELECT CONVERT(datetime, MAX(CASE QAVariable WHEN 'DATE:D' THEN > DataValue END)) AS [DATE:D], CONVERT(datetime, > MAX(CASE QAVariable WHEN 'TIME:T' THEN DataValue > END)) AS [TIME:T], CONVERT(nvarchar(250), MAX(CASE QAVariable WHEN > 'LOCATION:A' THEN DataValue END)) <horrible SQL snipped> > DATASETID, RowGUID > FROM dbo.v_QISDataValue > WHERE (DataSetID = 1) > GROUP BY RowGUID
Thanks a lot, Steve. That's 20 seconds of my life I won't get back. Glad I don't work there!!! I do wonder about the advantage of the view over a SP though.... -- Mike Babcock, MCP MB Software Solutions, LLC President, Chief Software Architect http://mbsoftwaresolutions.com http://fabmate.com http://twitter.com/mbabcock16 _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

