I have a database that houses daily data that is entered everyday for the previous day (for example yesterday's data will be entered today, and today's data will be entered tomorrow). The problem I have is that I need to query the previous days data to pull a field for calculations today. In other words I need a piece of data from 8/1/03 to run calculations that are based partly on data entered today in a report for today.
I tried this query:
SELECT [Adjustments].[Date], [Adjustments].[Type], [Adjustments].[Adjustments]
FROM Adjustments
WHERE (date)=(SELECT MAX(Adjustments.Date) from Adjustments WHERE Date<DATE());
but because we enter yesterday's data today, the max dat<date() is yesterday, and I need Friday's data.
I really hope I am explaining this correctly. Any thoughts would be greatly appreciated.
pc
I tried this query:
SELECT [Adjustments].[Date], [Adjustments].[Type], [Adjustments].[Adjustments]
FROM Adjustments
WHERE (date)=(SELECT MAX(Adjustments.Date) from Adjustments WHERE Date<DATE());
but because we enter yesterday's data today, the max dat<date() is yesterday, and I need Friday's data.
I really hope I am explaining this correctly. Any thoughts would be greatly appreciated.
pc