cancel
Showing results for 
Search instead for 
Did you mean: 

Alert for orders based on due date

Former Member
0 Kudos

Hi All

I need to query to get sales order based on tomorrow date.

scenario:

Sales orders are imported using DTW and due date is put in as tomorrow , so i need a query to show me all the imported orders based on due date.

check below the query i'm using

SELECT T0.DocNum, T0.DocDueDate, T0.CardCode, T0.CardName, T0.DocTotal, T0.U_ROUTEMARKTN, T0.U_ROUNDS, T0.U_DAYOFWEEK

FROM [dbo].[ORDR] T0

WHERE DATEDIFF(Day, T0.DocDUEDate, GETDATE()) = 0

ORDER BY T0.U_ROUTEMARKTN, T0.U_ROUNDS, T0.U_DAYOFWEEK, T0.DocDueDate

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bongani,

Change your query condition to:

WHERE DATEDIFF(Day, T0.DocDUEDate, GETDATE(), T0.DocDUEDate) = 1

Gordon

Former Member
0 Kudos

Sorry. The first DocDueDate should be deleted:

WHERE DATEDIFF(Day, GETDATE(), T0.DocDUEDate) = 1

Gordon

Former Member
0 Kudos

Thanks

Gordon

Answers (0)