Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2007

Tip: Looking for answers? Try searching our database.

Data Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gerry - 13 Nov 2007 16:31 GMT
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
John Spencer - 13 Nov 2007 17:04 GMT
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.

Signature

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

> Hello there
>
[quoted text clipped - 8 lines]
> Thx
> Gerry
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.