Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10022

Re: Is there a field to show date/time that doc was closed

$
0
0

Hi,

 

Try this query and let me know your feedback.

 

SELECT T0.[DocNum], T0.[DocStatus],T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Quantity], t3.doctime as 'Closing Time', t3.docdate as 'Closed Date' FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry left join PDN1 T2 on  T2.[BaseEntry]  = t0.docentry and  T2.[BaseLine]  =  T1.[LineNum] INNER JOIN OPDN T3 ON T2.DocEntry = T3.DocEntry WHERE T3.[DocDate] = CONVERT(VARCHAR(10),GETDATE(),110) and (CONVERT(varchar, datepart(hour, getdate())) + '' + CONVERT(varchar, datepart(minute, getdate())) - t3.doctime) <= 60 and  T0.[CANCELED]  = 'N'

 

Thanks & Regards,

Nagarajan


Viewing all articles
Browse latest Browse all 10022

Trending Articles