PDA

Click to See Complete Forum and Search --> : regarding a sql query in MS Acess


Nemo
Nov 2nd, 2000, 11:39 PM
Try this one


SELECT * FROM Orders WHERE (Orders.dateofreceipt>text1.text .and. Orders.dateofreceipt<text2.text)

make sure text1.text and text2.text are properly formatted to reflect dates.

paulw
Nov 3rd, 2000, 03:18 AM
You can use Between...And in Access as well. Don't forget to include the date literal characters #! Check out the help topic on Between...And in Access and have a look at the Example - that will give you what you want.

Cheers,

Paul.

visualsander
Nov 3rd, 2000, 08:20 AM
Hi,

If you're building in Access and thus running the queries within access why not build the query in "design"-mode?

You just add the needed tables;
then drag the needed fields;
right click in the "criteria" field and select "build..." (or something like that)
click "BETWEEN"
Select the first field
click "AND"
select the second field
click OK

that should also work.

You can than look in "SQL"-mode for the correct SQL-statement!

regards,


visual sander