By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

Using dates entered on a form to use in query

P: n/a
If I want a user to enter in dates on a form, how do you use that as
part of your selection criteria in a query? What is the format?

User enter in beginning and ending date.

For example, have query run:

select * from someTable where begDate>=[date on form] and
endDate<=[date on form];

May 17 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On May 17, 2:03 pm, mscu...@gmail.com wrote:
If I want a user to enter in dates on a form, how do you use that as
part of your selection criteria in a query? What is the format?

User enter in beginning and ending date.

For example, have query run:

select * from someTable where begDate>=[date on form] and
endDate<=[date on form];
Place as critera in the query.

forms!formName!ObjectName

Example
forms!frmMain!cboStartDate

May 17 '07 #2

P: n/a
On 17 May 2007 12:03:36 -0700, ms*****@gmail.com wrote:
If I want a user to enter in dates on a form, how do you use that as
part of your selection criteria in a query? What is the format?

User enter in beginning and ending date.

For example, have query run:

select * from someTable where begDate>=[date on form] and
endDate<=[date on form];
Using your syntax....

select * from someTable where SomeTable.[DateField] >=
forms!NameOfForm![Beginning date Control on form] and <=
forms!NameOfForm![End date Control on form]

However, I would use Between And instead of >= and <=.

select * from someTable where SomeTable.[DateField] Between
forms!NameOfForm![Beginning date Control on form] and
forms!NameOfForm![End date Control on form]

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
May 17 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.