SELECT * FROM myTable WHERE Format(myDate, "dd/mm/yyyy") >[Forms]![run_report]![Fro
Main Topics
Browse All TopicsHi
This is probably quite easy but: I am doing a query and it needs to run between dates that are entered. From example any date from the 01/02/2004 to the 29/02/2004.
The data it reads from has the date as follows (example):
01/01/2003 14:00:00
Obviosly i only want my query to read the first half of the above (the date bit), is thing something to do with 'leftstring'?
The expression i use at the moment is:
>[Forms]![run_report]
Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
also you may want to use >= and <= to include the dates entered.
Change myTable to your table and myDate to your date field.
If your filed is called "Date" then youll need to use [Date] rather than Date. Date is a reserved word in access, and if your field is called this, i recommed changing iit
Good Luck!
Dave
rather than using this form:
SELECT * FROM myTable WHERE Format(myDate, "dd/mm/yyyy") >[Forms]![run_report]![Fro
use this form:
SELECT * FROM myTable WHERE Format(myDate, "dd/mm/yyyy") BETWEEN [Forms]![run_report]![From
AW
Business Accounts
Answer for Membership
by: flavoPosted on 2004-03-04 at 02:39:55ID: 10512765
Hey Darren,
m] ANDFormat(myDate, "dd/mm/yyyy") < [Forms]![run_report]![To]
Try this
SELECT * FROM myTable WHERE Format(myDate, "dd/mm/yyyy") >[Forms]![run_report]![Fro
Dave!