Day Before Price

mugman17

Registered User.
Local time
Today, 22:14
Joined
Nov 17, 2000
Messages
110
I have a query where I am looking to get the price from the day before.

Here is what I have so far:

SELECT [tblPrice].[PriceID], [tblPrice].[LocationID], [tblPrice].[Price], [tblPrice].[ChangeinPrice], [tblPrice].[priceDate], DateAdd("d",-1,[PriceDate]) AS DayBefore
FROM tblPrice;

The DayBefore will give me the date of the previous day, now how do I pull the previous days price out of this?
 
SELECT [tblPrice].[PriceID], [tblPrice].[LocationID], [tblPrice].[Price], [tblPrice].[ChangeinPrice], [tblPrice].[PriceDate] FROM tblPrice WHERE ((([tblPrice].[priceDate]) = DateAdd("d",-1,[PriceDate])));
 
For some strange reason, it does not work. I get no data when I do this.
 
What happens if there is no data for the date before?
 
Also, can you post an Access '97 example?
 

Users who are viewing this thread

Back
Top Bottom