does it include [date]?

mariaw

Registered User.
Local time
Today, 21:13
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
 
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
 
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

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
 
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.
 
Thanks very much MStef - works a treat!!!
And thanks to FoFa for your help too :)

Maria
 

Users who are viewing this thread

Back
Top Bottom