Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ignoring the time part of date format.

Status
Not open for further replies.

cmcdonald

Technical User
Aug 2, 2000
11
EU
I am trying to write a parameter query to retrieve records between two dates. The date format in the table is dd:mm:yy hh:mm:ss (and I cannot change this).<br><br>How do I write the query so that the users need only enter the dd:mm:yy part of the dates they wish to query between?<br><br>Cara
 
You can just ignore the time part, when passing the data to the query.&nbsp;&nbsp;You can just pass the date part.&nbsp;&nbsp;Be VERY careful, when doing your query.&nbsp;&nbsp;When the time is not passes, Access assumes 12:00:00 am (I think that's the time), so if you use &quot;Between #1/1/2000# and #1/15/2000#&quot; you don't get back the records from the 15th, since the records in your table are probably later than 12:00:00 am.<br><br>I might not be describing this well, but it is a well-known little &quot;gotcha&quot; that you have to be aware of.<br><br> <p>Kathryn<br><a href=mailto: > </a><br><a href= > </a><br>
 
Yeah, I found that out the hard way. I guess I was hoping there was a way around it. :)<br><br>Thanks
 
What I usually do is let the user put the the values that makes sense; in my example 1/1 and 1/15, and then behind the scenes add one day to 1/15.&nbsp;&nbsp;Then the results are correct. <p>Kathryn<br><a href=mailto: > </a><br><a href= > </a><br>
 
I can't seem to get the syntax right with the parameter to add a day. Could you give me a hand?<br><br>Cara
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top