kentwoodjean
Technical User
Trying to make a query from a talble so that I can get a current inventory count for each day while keeping the previous dates in place. Below is the SQL of where I am at so far. The tblLastUpdated contains several dates having to do with when the contract was received, when it was last updated, but nothing that day by day gives me the ending inventory number. I cannot adjust the primary tables as they are downloaded from our main frame and will populate the numbers in my query. Can I add a field to the query to reflect current day, and tomorrow show that date and number as well as today’s date and number? In other words, everyday will reflect a new date or the current date with the current inventory count while all the past days and their count will remain as well.
SELECT Count(tblLastUpdated.[Contract #]) AS [CountOfContract #], RespCdeLst.RespMain
FROM tblLastUpdated INNER JOIN RespCdeLst ON tblLastUpdated.[Resp Cd] = RespCdeLst.RespCde
WHERE (((tblLastUpdated.[Closed Dt]) Is Null))
GROUP BY RespCdeLst.RespMain
HAVING (((RespCdeLst.RespMain)="professional"));
SELECT Count(tblLastUpdated.[Contract #]) AS [CountOfContract #], RespCdeLst.RespMain
FROM tblLastUpdated INNER JOIN RespCdeLst ON tblLastUpdated.[Resp Cd] = RespCdeLst.RespCde
WHERE (((tblLastUpdated.[Closed Dt]) Is Null))
GROUP BY RespCdeLst.RespMain
HAVING (((RespCdeLst.RespMain)="professional"));