Hi,
I'm having some problems interpreting the below code into an expression for a derived column. I'm trying to get the difference in minutes from when a purchase order was created (this would be the CreateTime in the code) and when the order was actually shipped indicated by POReleaseTime. Is it possible to convert this code to an expression? Does anyone have examples that could get me on track? Thanks in advance.
Brian
select DateDiff(n,
(CASE WHEN DATEPART(DW, PCR.CreateDate) IN (1,7) THEN '7:00:00 AM'
WHEN DATEDIFF(n,'4:59:00 PM',PCR.CreateTime)>0 THEN '7:00:00 AM'
WHEN DATEDIFF(n,'6:59:00 AM',PCR.CreateTime)<0 THEN '7:00:00 AM'
ELSE PCR.CreateTime END),PCR.POReleaseTime) AS pMinutes
I'm having some problems interpreting the below code into an expression for a derived column. I'm trying to get the difference in minutes from when a purchase order was created (this would be the CreateTime in the code) and when the order was actually shipped indicated by POReleaseTime. Is it possible to convert this code to an expression? Does anyone have examples that could get me on track? Thanks in advance.
Brian
select DateDiff(n,
(CASE WHEN DATEPART(DW, PCR.CreateDate) IN (1,7) THEN '7:00:00 AM'
WHEN DATEDIFF(n,'4:59:00 PM',PCR.CreateTime)>0 THEN '7:00:00 AM'
WHEN DATEDIFF(n,'6:59:00 AM',PCR.CreateTime)<0 THEN '7:00:00 AM'
ELSE PCR.CreateTime END),PCR.POReleaseTime) AS pMinutes