Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Clarion date conversion

$
0
0

I have a clarion date I need to have converted contained within a pivot. Is their an expression for converting the clarion date with report builder or do I need to convert it within the query? I am using SQL 2008 R2 report builder. I have attached my query below with the clarion portion markedBlue:

 

;with cte as (SELECT    CAT2.Personnel.EMPLOYEENAME AS [Employee Name], CAT2.CCPsamples.MEASURE, CAT2.CCPsamples.SAMPLEVALUE AS Result,

                     DATEADD(second,1 * (DATEDIFF(second, '20000101', F.[Date/Time]) /1), '20000101')as [Date_Time], CAT2.CCPsamples.SAMPLECOMMENT AS [Comments],CAT2.CCPsamples.DATASETNUMBER AS [Data],CAT2.CCPsamples.SAMPLEDESCRIPTION AS [Root Cause]

FROM        CAT2.Personnel INNER JOIN

                     CAT2.CCPsamples ON CAT2.Personnel.EMPLOYEENO = CAT2.CCPsamples.EMPLOYEENO INNER JOIN

                     CAT2.Activities ON CAT2.CCPsamples.ACTIVITY_NAME = CAT2.Activities.ACTIVITY_NAME

CROSS APPLY (select dbo.SQLDateTime(CAT2.CCPsamples.SAMPLEDATE, CAT2.CCPsamples.SAMPLETIME)

 AS [Date/Time]) F

WHERE F.[Date/Time] >= @MyStartDate AND

 F.[Date/Time] <= @MyEndDate AND F.[Date/Time] <>0 AND

 CAT2.Activities. DEPARTMENT = 343)

select [Root Cause] as [Root Cause], [Employee Name] as [Employee Name], [Date_Time] as [Date_Time],[New Label Date] as[New Label Date],[New Product #] as [New Product #],[Comments] as [Comments],[Data] as [Data],[New Serial #] as [New Serial #],[Original Label Date]as[Original Label Date],[Original ProductCode] as [Original ProductCode],[Original Serial #] as [Original Serial #]

from cte pivot (sum(result)

FOR Measure IN ([New Label Date],[New Product #],[New Serial #],[Original Label Date],[Original ProductCode],[Original Serial #])) AS pvt

ORDER BY [Date_Time]

 


David Donovan

Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>