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 2005

Tip: Looking for answers? Try searching our database.

Criteria for one field be based on another field?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kou Vang - 10 Nov 2005 17:03 GMT
I have a date field with proper a criteria statement to give me the dates I
want.  I also need however the time in hours as well.  If I start at 1:00PM
one day, then I want to end at 12:00PM at the end date.  I can get the dates,
but how do I get the hours to match exactly with the dates?  I already have
the hours stored in a table ready to be used in the criteria statement, just
a little confused on how to get out what I need.  Example:

8/03/2005  1:00PM
8/05/2005  12:00PM

Instead, I get all the hours for the last date.  Can I combine a statement
to the Date field that would read the ending date and the ending time?  
Thanks.
[MVP] S.Clark - 10 Nov 2005 17:54 GMT
Your desired object is not clear.  Please repost with more detail.  Maybe a
table structure or two as well.

There are several Functions dedicated to working with dates:
DateAdd
DateDiff
Date
etc...

Signature

Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

>I have a date field with proper a criteria statement to give me the dates I
> want.  I also need however the time in hours as well.  If I start at
[quoted text clipped - 13 lines]
> to the Date field that would read the ending date and the ending time?
> Thanks.
Kou Vang - 10 Nov 2005 18:51 GMT
Ok...so far I got this in my query:

Column 1

Field: Date
Criteria:
>=Dlookup("[BegDAte]","[BegEnd;")and<=Dlookup("[EndDate]","[BegEnd]")
Or: Dlookup("[EndDate]","[BegEnd]")

Colum 2

Field: Time
Criteria: Dlookup("[BegTime]","[BegEnd]")
Or: ?

I know I need something else to reference that end hour(EndTime).  Any idea?
[MVP] S.Clark - 14 Nov 2005 19:14 GMT
This is a disaster.  There are far too many syntax errors to even save the
query.

Also, naming field with Time and Date is not recommended.

> Ok...so far I got this in my query:
>
[quoted text clipped - 13 lines]
> I know I need something else to reference that end hour(EndTime).  Any
> idea?
 
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.