does it include [date]? (1 Viewer)

mariaw

Registered User.
Local time
Today, 15:29
Joined
Jun 9, 2006
Messages
88
Hi All

Is there something I can write in to a query which will tell me whether the 1 April 2006 appears in between two dates (which are entered by a user?)

For example, if they put the first date (which is one field) as 25/3/06 and then they put the end date (which is another field) as 4/4/06 - I just want the query to produce the word "yes"?

Thanks

Maria
 

FoFa

Registered User.
Local time
Today, 09:29
Joined
Jan 29, 2003
Messages
3,672
SELECT IIF([MyDate] Between Forms!MyForm!StartDate AND Forms!MyForm!EndDate,"YES","NO") as InDateRange
FROM MyTable
OR
SELECT IIF([MyDate] >= Forms!MyForm!StartDate AND [MyDate] <= Forms!MyForm!EndDate,"YES","NO") as InDateRange
FROM MyTable

just comes to mind
 

MStef

Registered User.
Local time
Today, 15:29
Joined
Oct 28, 2004
Messages
2,251
Hello Maria!

Look at "Demo0104A2000.mdb" (attachment)
Open Form1 and try.
Look at Table, Query1, Module1.
I suggest make a report on this query.
 

Attachments

  • Demo0104A2000.zip
    12.8 KB · Views: 99

mariaw

Registered User.
Local time
Today, 15:29
Joined
Jun 9, 2006
Messages
88
Hello both

Thanks for the suggestions; queries for both of you!

Fofa: so I assume I make a form where someone enters the date 1st April 2006?

MStef: sorry but when I try and open the database (once I unzip it) is says it is an unrecognised format; I am using MA 1997?

Thanks!!

Maria
 

FoFa

Registered User.
Local time
Today, 09:29
Joined
Jan 29, 2003
Messages
3,672
Well you said a date someone enters. I just assumed a form. If one supplied date needs to be used in different places, a form is one of the easiest ways.
 

MStef

Registered User.
Local time
Today, 15:29
Joined
Oct 28, 2004
Messages
2,251
Hello Maria!

Look at Access97 format.
 

Attachments

  • Demo0104A97.zip
    21.3 KB · Views: 91

mariaw

Registered User.
Local time
Today, 15:29
Joined
Jun 9, 2006
Messages
88
Thanks very much MStef - works a treat!!!
And thanks to FoFa for your help too :)

Maria
 

Users who are viewing this thread

Top Bottom