on 07-23-2008 4:15 PM
Hi all
I need a query that will copy today's date on posted sales order via DTW then that query will be linked to an alert and be sent to the sales manager every morning after the import went through successfully.
The report at the moment is running fine as i pulling through the other info required the only problem is it's pulling all the sales orrders on the system , we want it to pull only the days orders imported.
You could use either of these queries
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 T0.DocDate = GETDATE()
ORDER BY T0.U_ROUTEMARKTN, T0.U_ROUNDS, T0.U_DAYOFWEEK, T0.DocDueDate
OR
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.DocDate, GETDATE()) = 0
ORDER BY T0.U_ROUTEMARKTN, T0.U_ROUNDS, T0.U_DAYOFWEEK, T0.DocDueDate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bongani.
Try this:
WHERE day(t0.docdate) = day(getdate()) and month(t0.docdate) = month(getdate()) and year(t0.docdate) = year(getdate())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you could share the query I could help you filter them for the current date
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bongani,
To pull todays date from the db try - 'select getdate()'
How you want to incorporate that into your query I leave to you.
Hope it helps.
Jesper
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.