Needs help about a query with dates

nilses

Registered User.
Local time
Today, 13:55
Joined
Jan 2, 2003
Messages
45
Hello

I wish to make a function but I do not make it and I require your assistance. I have a query with 76000 recordings and I have a field with a date. I wish when I launch my query to have all recordings of the previous day . We are thuesday on 03/18/03 and i would like the recordings for yesterday 03/17/03 but when the day is Monday, i would like all recordings for Friday and saturday.

I do this in my query but it doesn't work for Monday

SELECT MyDate, MyName, MyCountry, MyLastName FROM Rin WHERE MyDate Like Date()-1));

I do not see how to make that, could you help me.

Thank you for your assistance.

Nilses
 
Try this:

SELECT MyDate, MyName, MyCountry, MyLastName FROM Rin WHERE MyDate = IIf(Weekday(Date())=2, MyDate Between Date()-3 And Date(), Date()-1);
 
Thanks Mile-O-Phile

Thanks for your help, but it doesn't work. Access display a window and this window wait a parameter, it's strange!!

Your help will be appreciated

Nilses
 
What parameter is it asking for?
 

Users who are viewing this thread

Back
Top Bottom