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 Dates Criteria



 
 
Thread Tools Display Modes
  #1  
Old February 18th, 2010, 09:24 PM posted to microsoft.public.access.queries
Apprentice
external usenet poster
 
Posts: 3
Default Between Dates Criteria

Can’t' seem to get it. I have two fields: Start_Date and End_Date. Both are
Short Date Format.

Note: Both date fields are previously calculated dates from the original
"Review_Date field. Like, Review_Date+10 is the Start_Date and Review_Date+20
is the End_Date.

I want to use a between dates criteria using both fields. I have researched
and tried so many combinations to list here without success.

**** The dates I ask for are never correct, or within the parameter entered.
Either one or the other is off.

I have even tried two parameters, [Enter Start Date] on the End_Date field
criteria -
and [Enter End Date] on the End_Date field criteria

Is this something simple I'm just missing?

--
Your guidance is greatly appreciated!
  #2  
Old February 18th, 2010, 09:46 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Between Dates Criteria

Try this in the query design view --
In a blank column of the grid in the Field row type --
My_Date_Check: CVDate([Enter date to check])

In the criteria row below that type this --
Between [Start_Date] AND [End_Date]

--
Build a little, test a little.


"Apprentice" wrote:

Can’t' seem to get it. I have two fields: Start_Date and End_Date. Both are
Short Date Format.

Note: Both date fields are previously calculated dates from the original
"Review_Date field. Like, Review_Date+10 is the Start_Date and Review_Date+20
is the End_Date.

I want to use a between dates criteria using both fields. I have researched
and tried so many combinations to list here without success.

**** The dates I ask for are never correct, or within the parameter entered.
Either one or the other is off.

I have even tried two parameters, [Enter Start Date] on the End_Date field
criteria -
and [Enter End Date] on the End_Date field criteria

Is this something simple I'm just missing?

--
Your guidance is greatly appreciated!

  #3  
Old February 18th, 2010, 09:50 PM posted to microsoft.public.access.queries
vanderghast
external usenet poster
 
Posts: 593
Default Between Dates Criteria

To work, it must be real date_time datatype, NOT string datatype. Since you
mention a format, a format result is a string! and for strings, the order is
like "A", "AZZZ", "B", and also "1", "1999", "2" ( while 1999 2,
"1999" "2", that is a difference between numbers and strings).


Try to convert your strings into date datatype, with CDate (in SQL view) :


.... WHERE (someOtherCriteria)
AND (dateTimeField BETWEEN CDate(stringOfDate1) AND
CDate(stringOfDate2))
AND (yetSomeOtherCriteriaAgain)


Vanderghast, Access MVP


"Apprentice" wrote in message
...
Can’t' seem to get it. I have two fields: Start_Date and End_Date. Both
are
Short Date Format.

Note: Both date fields are previously calculated dates from the original
"Review_Date field. Like, Review_Date+10 is the Start_Date and
Review_Date+20
is the End_Date.

I want to use a between dates criteria using both fields. I have
researched
and tried so many combinations to list here without success.

**** The dates I ask for are never correct, or within the parameter
entered.
Either one or the other is off.

I have even tried two parameters, [Enter Start Date] on the End_Date field
criteria -
and [Enter End Date] on the End_Date field criteria

Is this something simple I'm just missing?

--
Your guidance is greatly appreciated!


 




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 04:28 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.