Date Range: Between [Start Date] and [End Date] problem

K

KL

I am trying to use the following date range function to
get the "Start Date" and "End Date" from the Form. But
somehow it didn't work. Andy idea?

Between [Forms]![f_PartsUsage]![StartDate] And [Forms]!
[f_PartsUsage]![EndDate]
 
V

Van T. Dinh

Is the Form open and the Controls have values while the Query is being run?

Otherwise, describe your set-up, post the SQL String of your Query and the
result you got ("didn't work" doesn't give much info!).
 
K

KL

The form is open.

The function "between [StartDate] and [EndDate]" works
only the with real date as the parameter, e.g. "between
#10/01/2003# and #10/30/2003#, but it doesn't work
with "Between [Forms]![f_PartsUsage]![StartDate] And
[Forms]![f_PartsUsage]!

Please advise.

(e-mail address removed)



[EndDate]"
-----Original Message-----
Is the Form open and the Controls have values while the Query is being run?

Otherwise, describe your set-up, post the SQL String of your Query and the
result you got ("didn't work" doesn't give much info!).

--
HTH
Van T. Dinh
MVP (Access)



I am trying to use the following date range function to
get the "Start Date" and "End Date" from the Form. But
somehow it didn't work. Andy idea?

Between [Forms]![f_PartsUsage]![StartDate] And [Forms]!
[f_PartsUsage]![EndDate]


.
 
D

Duane Hookom

You were asked to provide your SQL view for us to review. You are asking a
question that should work exactly as you have tried. We can't help further
if you don't provide more information.

--
Duane Hookom
MS Access MVP


KL said:
The form is open.

The function "between [StartDate] and [EndDate]" works
only the with real date as the parameter, e.g. "between
#10/01/2003# and #10/30/2003#, but it doesn't work
with "Between [Forms]![f_PartsUsage]![StartDate] And
[Forms]![f_PartsUsage]!

Please advise.

(e-mail address removed)



[EndDate]"
-----Original Message-----
Is the Form open and the Controls have values while the Query is being run?

Otherwise, describe your set-up, post the SQL String of your Query and the
result you got ("didn't work" doesn't give much info!).

--
HTH
Van T. Dinh
MVP (Access)



I am trying to use the following date range function to
get the "Start Date" and "End Date" from the Form. But
somehow it didn't work. Andy idea?

Between [Forms]![f_PartsUsage]![StartDate] And [Forms]!
[f_PartsUsage]![EndDate]


.
 
J

John Spencer (MVP)

Try declaring your parameters so you can specify the parameter type. It is
possible that Access is treating them as a math equation so that 1/1/1989 is
being treated as 1 divided by 1 divided by 1989 which gives a very small number
which is treated as a date and time on Dec 30, 1899.

Parameters [Forms]![f_PartsUsage]![StartDate] Datetime,
[Forms]![f_PartsUsage]![EndDate] DateTime;
SELECT ...
FROM ...
WHERE ...


The form is open.

The function "between [StartDate] and [EndDate]" works
only the with real date as the parameter, e.g. "between
#10/01/2003# and #10/30/2003#, but it doesn't work
with "Between [Forms]![f_PartsUsage]![StartDate] And
[Forms]![f_PartsUsage]!

Please advise.

(e-mail address removed)

[EndDate]"
-----Original Message-----
Is the Form open and the Controls have values while the Query is being run?

Otherwise, describe your set-up, post the SQL String of your Query and the
result you got ("didn't work" doesn't give much info!).

--
HTH
Van T. Dinh
MVP (Access)



I am trying to use the following date range function to
get the "Start Date" and "End Date" from the Form. But
somehow it didn't work. Andy idea?

Between [Forms]![f_PartsUsage]![StartDate] And [Forms]!
[f_PartsUsage]![EndDate]


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top