Date query

N

nevpoe

I am running a query based on dates. I am using the between and operant. My
problem is that the query does not include the end date. If I put in
7/1/05-7/31/05, I only get the information up to 7/30/05. How do I get the
query to include the end date?
 
S

Sheila D

Access normally includes the first and last date in the bBetween statement,
sill question but are you sure you have records for 31st July?
 
O

Ofer

Are the date entered as parameters
Where MyField Between [Enter Start Date] and [Enter End Date]

In that case try and covert the parameters to date
Where MyField Between cvdate([Enter Start Date]) and cvdate([Enter End Date])
 
N

nevpoe

Sorry it has been so long. Vacation. I tried your CVDate solution, and it
didn't work I still can't get the query to included the end date.

Ofer said:
Are the date entered as parameters
Where MyField Between [Enter Start Date] and [Enter End Date]

In that case try and covert the parameters to date
Where MyField Between cvdate([Enter Start Date]) and cvdate([Enter End Date])

nevpoe said:
I am running a query based on dates. I am using the between and operant. My
problem is that the query does not include the end date. If I put in
7/1/05-7/31/05, I only get the information up to 7/30/05. How do I get the
query to include the end date?
 
N

nevpoe

I think that my problem has to do with the fact that I am collecting date
including the hour, but I am only asking for dates without time in the
prompt. I tried
= [Forms]![frmReports]![edtStartDate] And
< ([Forms]![frmReports]![edtEndDate] + 1)

But I ended up with all sorts of errors. I think it may be on the right
track, but I am still not there.

Ofer said:
Are the date entered as parameters
Where MyField Between [Enter Start Date] and [Enter End Date]

In that case try and covert the parameters to date
Where MyField Between cvdate([Enter Start Date]) and cvdate([Enter End Date])

nevpoe said:
I am running a query based on dates. I am using the between and operant. My
problem is that the query does not include the end date. If I put in
7/1/05-7/31/05, I only get the information up to 7/30/05. How do I get the
query to include the end date?
 
O

Ofer

Try this, to remove the houres

Where cvdate(format(MyField,"dd/mm/yyyy")) Between cvdate([Enter Start
Date]) and cvdate([Enter End Date])

nevpoe said:
I think that my problem has to do with the fact that I am collecting date
including the hour, but I am only asking for dates without time in the
prompt. I tried
= [Forms]![frmReports]![edtStartDate] And
< ([Forms]![frmReports]![edtEndDate] + 1)

But I ended up with all sorts of errors. I think it may be on the right
track, but I am still not there.

Ofer said:
Are the date entered as parameters
Where MyField Between [Enter Start Date] and [Enter End Date]

In that case try and covert the parameters to date
Where MyField Between cvdate([Enter Start Date]) and cvdate([Enter End Date])

nevpoe said:
I am running a query based on dates. I am using the between and operant. My
problem is that the query does not include the end date. If I put in
7/1/05-7/31/05, I only get the information up to 7/30/05. How do I get the
query to include the end date?
 
N

nevpoe

Still no good. This time I got "expression to complicated" error.


Then I tried

Where cvdate(MyField)Between cvdate([Enter Start
Date]) and cvdate([Enter End Date])

and got no records returned in my query.


Ofer said:
Try this, to remove the houres

Where cvdate(format(MyField,"dd/mm/yyyy")) Between cvdate([Enter Start
Date]) and cvdate([Enter End Date])

nevpoe said:
I think that my problem has to do with the fact that I am collecting date
including the hour, but I am only asking for dates without time in the
prompt. I tried
= [Forms]![frmReports]![edtStartDate] And
< ([Forms]![frmReports]![edtEndDate] + 1)

But I ended up with all sorts of errors. I think it may be on the right
track, but I am still not there.

Ofer said:
Are the date entered as parameters
Where MyField Between [Enter Start Date] and [Enter End Date]

In that case try and covert the parameters to date
Where MyField Between cvdate([Enter Start Date]) and cvdate([Enter End Date])

:

I am running a query based on dates. I am using the between and operant. My
problem is that the query does not include the end date. If I put in
7/1/05-7/31/05, I only get the information up to 7/30/05. How do I get the
query to include the end date?
 
O

Ofer

Can you post the all SQL, I'll check it
--
In God We Trust - Everything Else We Test


nevpoe said:
Still no good. This time I got "expression to complicated" error.


Then I tried

Where cvdate(MyField)Between cvdate([Enter Start
Date]) and cvdate([Enter End Date])

and got no records returned in my query.


Ofer said:
Try this, to remove the houres

Where cvdate(format(MyField,"dd/mm/yyyy")) Between cvdate([Enter Start
Date]) and cvdate([Enter End Date])

nevpoe said:
I think that my problem has to do with the fact that I am collecting date
including the hour, but I am only asking for dates without time in the
prompt. I tried

= [Forms]![frmReports]![edtStartDate] And
< ([Forms]![frmReports]![edtEndDate] + 1)

But I ended up with all sorts of errors. I think it may be on the right
track, but I am still not there.

:

Are the date entered as parameters
Where MyField Between [Enter Start Date] and [Enter End Date]

In that case try and covert the parameters to date
Where MyField Between cvdate([Enter Start Date]) and cvdate([Enter End Date])

:

I am running a query based on dates. I am using the between and operant. My
problem is that the query does not include the end date. If I put in
7/1/05-7/31/05, I only get the information up to 7/30/05. How do I get the
query to include the end date?
 
Top