A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Between [First Date] And [Last date]



 
 
Thread Tools Display Modes
  #11  
Old March 1st, 2010, 09:40 PM posted to microsoft.public.access.queries
Peter
external usenet poster
 
Posts: 962
Default Between [First Date] And [Last date]

John, Rick,Duane,kc-mass...I am much obliged. Thank you indeed...Looking at
all these suggestions..and testing..it is simple....thats why it is
difficult.. It works when adding a day in seconds or not using the Between
but operators..

Once again, Thank you for the lesson...i learned something new today..

"John Spencer" wrote:

Dang!! Wrong constant there are 86400 seconds in a day not 24000.

BETWEEN [First Date] and DateAdd("s",86399,[Last Date])

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

John Spencer wrote:
Try using the following criteria

BETWEEN [First Date] and DateAdd("s",23599,[Last Date])

The DateAdd function adds 23599 seconds to the value of Last Date so
that the datetime value is one second before midnight on the date you
enter for Last Date. So you will get all records between midnight of
first date and one second before midnight on the last date.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Peter wrote:
Hiand thanks, but i am a lite confused. I use the Between [First Date]
and [Last Date) in a parameter/criteria that results in two small
popup windows where the user populate the frst date and second in
order to retrive allrecords between these two dates...but i dont
understand how that would function in your solution..all i want to do
is to retrieve records between two dates...The datecreated field is
populated by code and it seems that i can not just reformat the field
to ex dd-mm-yy.

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.