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 / July 2006

Tip: Looking for answers? Try searching our database.

Using BETWEEN AND with DatePart

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dlmaley - 13 Jul 2006 17:14 GMT
In MS Access 97, I am trying to design an update query that will update a
field (SICKTIME) to 0 if another field (STARTDATE) is between 1/2 (January
2nd) and 5/1 (May 1st) in the same year as another field (ASOFDATE). The user
enters the ASOFDATE in another part of the process so that field is already
populated. I am trying to do this with BETWEEN AND and DatePart and can’t get
it to work. This is what I have now as the criteria for updating the field.

Between (DatePart("m",[STARTDATE])=1 And DatePart("d",[STARTDATE])=2 And
DatePart("yyyy",[STARTDATE])=DatePart("yyyy",[ASOFDATE]))
And
(DatePart("m",[STARTDATE])=5 And DatePart("d",[STARTDATE])=1 And
DatePart("yyyy",[STARTDATE])=DatePart("yyyy",[ASOFDATE]))

The query runs but does not update the records it should update. Any help
would be appreciated. Thanks!
Jeff Boyce - 13 Jul 2006 18:39 GMT
Are you saying that if you treat the query as a "select" query, it returns
the proper rows?  If so, how are you converting that to an "update" query?
Where's the "update to" portion?

Regards

Jeff Boyce
Microsoft Office/Access MVP

> In MS Access 97, I am trying to design an update query that will update a
> field (SICKTIME) to 0 if another field (STARTDATE) is between 1/2 (January
[quoted text clipped - 15 lines]
> The query runs but does not update the records it should update. Any help
> would be appreciated. Thanks!
 
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.