We enter our production data in the database next day of production, I am using the following query to get the yesterday data.
Query works fine until after weekend, it shows nothing on Monday because there is no production on weekend.
Is there anyway I can change the query to show me the last day of production.
SELECT Date, ProductCode
FROM Production
WHERE (ProductCode In ('35032','40112-I','41212-I','50112','824-5'))
AND (Date=Dateadd(dd,-1,Convert(char(8),Current_timestamp,112)))