Date query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Access normally includes the first and last date in the bBetween statement,
sill question but are you sure you have records for 31st July?
 
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])
 
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?
 
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?
 
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?
 
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?
 
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?
 

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

Back
Top