Hi Below is a query that l would like it to read next day's date under Getdate . Please help with the correct fomular. Currently it reads todays date and data but l would like it to read next day as we do everything in advance( one day ahead).
SELECT OEORDH.ORDNUMBER, OEORDD.ITEM, OEORDD.[DESC], OEORDH.INVNUMBER, OEORDH.ORDDATE, OEORDD.QTYORDERED, OEORDD.AUDTUSER,
ICILOC.QTYONHAND - ICILOC.QTYSHNOCST + ICILOC.QTYRENOCST + ICILOC.QTYADNOCST AS QtyOnHand
FROM ICITEM INNER JOIN
ICILOC ON ICITEM.ITEMNO = ICILOC.ITEMNO INNER JOIN
OEORDH INNER JOIN
OEORDD ON OEORDH.ORDUNIQ = OEORDD.ORDUNIQ ON ICITEM.FMTITEMNO = OEORDD.ITEM
WHERE (DATEDIFF(dd, CONVERT(datetime, CAST(OEORDH.AUDTDATE AS NVARCHAR(10)) + N' 08:00:59.997', 112), GETDATE()) = 0) AND (OEORDD.LOCATION = 'G200') AND
(OEORDH.INVNUMBER = '*** NEW ***') AND (OEORDD.QTYSHIPPED = 0) AND (OEORDD.QTYORDERED <> 0) AND (ICILOC.LOCATION = 'G200')
ORDER BY OEORDD.ITEM
Your help is very much appreciated
SELECT OEORDH.ORDNUMBER, OEORDD.ITEM, OEORDD.[DESC], OEORDH.INVNUMBER, OEORDH.ORDDATE, OEORDD.QTYORDERED, OEORDD.AUDTUSER,
ICILOC.QTYONHAND - ICILOC.QTYSHNOCST + ICILOC.QTYRENOCST + ICILOC.QTYADNOCST AS QtyOnHand
FROM ICITEM INNER JOIN
ICILOC ON ICITEM.ITEMNO = ICILOC.ITEMNO INNER JOIN
OEORDH INNER JOIN
OEORDD ON OEORDH.ORDUNIQ = OEORDD.ORDUNIQ ON ICITEM.FMTITEMNO = OEORDD.ITEM
WHERE (DATEDIFF(dd, CONVERT(datetime, CAST(OEORDH.AUDTDATE AS NVARCHAR(10)) + N' 08:00:59.997', 112), GETDATE()) = 0) AND (OEORDD.LOCATION = 'G200') AND
(OEORDH.INVNUMBER = '*** NEW ***') AND (OEORDD.QTYSHIPPED = 0) AND (OEORDD.QTYORDERED <> 0) AND (ICILOC.LOCATION = 'G200')
ORDER BY OEORDD.ITEM
Your help is very much appreciated