Data Problem

  • Thread starter Thread starter Gerry
  • Start date Start date
G

Gerry

Hello there

I tried to make a query selecting data, one of the conditions turns
on the Date. My 'Date' field consists of a consecutive number of dates
except Week-end days.
When I use the criterium:
IIf(Date()-1=0,Date()-3, Date()-1) I don't get what I want. What I
want is that when running this query on mondays I get the info for
last friday.
Does anybody have any suggestion?
Thx
Gerry
 
Try this expression

IIF(WeekDay(Date())=2,Date()-3,Date()-1)

The criteria in your expression basically said if the system date is Dec 31,
1899 then use the date that was 3 days ago, otherwise use the date that was
yesterday.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top