Parameter Query Using Calendar Control

G

Guest

Hello;

I have been trying to design a query in an access project by creating a form
to take in start and end dates for a field through calendar controls. In the
criteria for the date field I have put:

'BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "#" and "#" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

I am getting this error when I do this:

'Data type error in expression.'

What am I doing wrong?
 
T

Tom Ellison

Dear More:

I think I see it:

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

You need the AND in the finished string!

Tom Ellison


"More Questions than Answers" <More Questions than
(e-mail address removed)> wrote in message
news:[email protected]...
 
G

Guest

Now it's giving me "Invalid or missing expression." Below is the revised
statement. do I have my quotes in the wrong places?

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"

Thanks in advance for the help!

Tom Ellison said:
Dear More:

I think I see it:

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

You need the AND in the finished string!

Tom Ellison


"More Questions than Answers" <More Questions than
(e-mail address removed)> wrote in message
Hello;

I have been trying to design a query in an access project by creating a
form
to take in start and end dates for a field through calendar controls. In
the
criteria for the date field I have put:

'BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "#" and "#" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

I am getting this error when I do this:

'Data type error in expression.'

What am I doing wrong?
 
G

Guest

I see, too, that I had an extra ' on the end of the statement, which I took
out.

Tom Ellison said:
Dear More:

I think I see it:

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

You need the AND in the finished string!

Tom Ellison


"More Questions than Answers" <More Questions than
(e-mail address removed)> wrote in message
Hello;

I have been trying to design a query in an access project by creating a
form
to take in start and end dates for a field through calendar controls. In
the
criteria for the date field I have put:

'BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "#" and "#" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

I am getting this error when I do this:

'Data type error in expression.'

What am I doing wrong?
 
T

Tom Ellison

Dear More:

The values in the referenced controls must be set. Are they? Check the
references to see they are correct. Correct form and column names, that is.

Tom Ellison


"More Questions than Answers"
Now it's giving me "Invalid or missing expression." Below is the revised
statement. do I have my quotes in the wrong places?

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"

Thanks in advance for the help!

Tom Ellison said:
Dear More:

I think I see it:

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

You need the AND in the finished string!

Tom Ellison


"More Questions than Answers" <More Questions than
(e-mail address removed)> wrote in message
Hello;

I have been trying to design a query in an access project by creating a
form
to take in start and end dates for a field through calendar controls.
In
the
criteria for the date field I have put:

'BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "#" and
"#" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

I am getting this error when I do this:

'Data type error in expression.'

What am I doing wrong?
 

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