Hi
I have this code (see below) and its start date is tomorrow. I need the code to show todays date also. I have another query that as todays date but cannot see the difference. Could someone tell me what I need to change to make it look at todays date please
SELECT dbrderHeader.DateRequired, SUM(dbrderLine.TotalVolume)
AS [Total Volume]
FROM dbrderHeader INNER JOIN
dbrderLine ON dbrderHeader.OrderID = dbrderLine.OrderID INNER JOIN
dbo.Product ON dbrderLine.ProductID = dbo.Product.ProductID INNER JOIN
dbo.ProductGroup ON dbo.Product.ProductGroupID = dbo.ProductGroup.ProductGroupID INNER JOIN
dbo.ProductGroup AS ProductGroup_1 ON dbo.ProductGroup.ParentID = ProductGroup_1.ProductGroupID
WHERE (dbrderHeader.StockIssued = 0) AND (ProductGroup_1.Name = 'Arborflor') AND (dbrderHeader.DateRequired >= GETDATE()) OR
(dbrderHeader.StockIssued = 0) AND (dbrderHeader.DateRequired >= GETDATE()) AND (dbo.ProductGroup.Name IN ('TREX')) AND
(dbrderHeader.DateRequired >= CAST(GETDATE() AS DATE)) AND (dbrderHeader.DateRequired <= DATEADD(day, 7, CAST(GETDATE() AS DATE)))
GROUP BY dbrderHeader.DateRequired, dbo.ProductGroup.Name
ORDER BY dbrderHeader.DateRequired
I have this code (see below) and its start date is tomorrow. I need the code to show todays date also. I have another query that as todays date but cannot see the difference. Could someone tell me what I need to change to make it look at todays date please
SELECT dbrderHeader.DateRequired, SUM(dbrderLine.TotalVolume)
AS [Total Volume]
FROM dbrderHeader INNER JOIN
dbrderLine ON dbrderHeader.OrderID = dbrderLine.OrderID INNER JOIN
dbo.Product ON dbrderLine.ProductID = dbo.Product.ProductID INNER JOIN
dbo.ProductGroup ON dbo.Product.ProductGroupID = dbo.ProductGroup.ProductGroupID INNER JOIN
dbo.ProductGroup AS ProductGroup_1 ON dbo.ProductGroup.ParentID = ProductGroup_1.ProductGroupID
WHERE (dbrderHeader.StockIssued = 0) AND (ProductGroup_1.Name = 'Arborflor') AND (dbrderHeader.DateRequired >= GETDATE()) OR
(dbrderHeader.StockIssued = 0) AND (dbrderHeader.DateRequired >= GETDATE()) AND (dbo.ProductGroup.Name IN ('TREX')) AND
(dbrderHeader.DateRequired >= CAST(GETDATE() AS DATE)) AND (dbrderHeader.DateRequired <= DATEADD(day, 7, CAST(GETDATE() AS DATE)))
GROUP BY dbrderHeader.DateRequired, dbo.ProductGroup.Name
ORDER BY dbrderHeader.DateRequired