Access 2007 leap year error

M

Millicent

I have Office 2007 Sp 1 installed.
When I attempt to create a report based on a query which has the following
code:

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

where [StartDate] and [EndDate] are fields in the form frmMonthlySelector;

For dates between 1/1/08 and 1/31/08 I get a full report including items
that have a date of 1/31/08.
However, when I enter dates between 2/1/08 and 2/29/08 the report shows
dates only from 2/1/08 and 2/28/08 and leaves off 2/29/08.
As a test I entered static values, ie:
Between #2/1/08# And #2/29/08#j
The report once again left off any items with a date of 2/29/08.
 
T

Tom Lake

Millicent said:
I have Office 2007 Sp 1 installed.
When I attempt to create a report based on a query which has the following
code:

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

where [StartDate] and [EndDate] are fields in the form
frmMonthlySelector;

For dates between 1/1/08 and 1/31/08 I get a full report including items
that have a date of 1/31/08.
However, when I enter dates between 2/1/08 and 2/29/08 the report shows
dates only from 2/1/08 and 2/28/08 and leaves off 2/29/08.
As a test I entered static values, ie:
Between #2/1/08# And #2/29/08#j
The report once again left off any items with a date of 2/29/08.

Have you tried

Between #2/1/08# And #3/1/08#

If so how does that work? Does it include 3/1 or not?

Tom Lake
 
M

Marshall Barton

Millicent said:
I have Office 2007 Sp 1 installed.
When I attempt to create a report based on a query which has the following
code:

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

where [StartDate] and [EndDate] are fields in the form frmMonthlySelector;

For dates between 1/1/08 and 1/31/08 I get a full report including items
that have a date of 1/31/08.
However, when I enter dates between 2/1/08 and 2/29/08 the report shows
dates only from 2/1/08 and 2/28/08 and leaves off 2/29/08.
As a test I entered static values, ie:
Between #2/1/08# And #2/29/08#j
The report once again left off any items with a date of 2/29/08.


Double check the date field in the table to see if the 2/29
record(s?) have a time part. If the field is set using the
Now function or users might enter a time part, then it will
be after midnight on 2/29

A safer way to do that criteria would be:
= [Forms]![frmMonthlySelector]![StartDate] And
< [Forms]![frmMonthlySelector]![EndDate] + 1
 
M

Millicent

Tom, I did try your suggestion and it did also give me March 1st.
However the suggestion from Marshall did work.

Tom Lake said:
Millicent said:
I have Office 2007 Sp 1 installed.
When I attempt to create a report based on a query which has the following
code:

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

where [StartDate] and [EndDate] are fields in the form
frmMonthlySelector;

For dates between 1/1/08 and 1/31/08 I get a full report including items
that have a date of 1/31/08.
However, when I enter dates between 2/1/08 and 2/29/08 the report shows
dates only from 2/1/08 and 2/28/08 and leaves off 2/29/08.
As a test I entered static values, ie:
Between #2/1/08# And #2/29/08#j
The report once again left off any items with a date of 2/29/08.

Have you tried

Between #2/1/08# And #3/1/08#

If so how does that work? Does it include 3/1 or not?

Tom Lake
 
M

Millicent

Marshall, thank you, your suggestion worked!

Marshall Barton said:
Millicent said:
I have Office 2007 Sp 1 installed.
When I attempt to create a report based on a query which has the following
code:

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

where [StartDate] and [EndDate] are fields in the form frmMonthlySelector;

For dates between 1/1/08 and 1/31/08 I get a full report including items
that have a date of 1/31/08.
However, when I enter dates between 2/1/08 and 2/29/08 the report shows
dates only from 2/1/08 and 2/28/08 and leaves off 2/29/08.
As a test I entered static values, ie:
Between #2/1/08# And #2/29/08#j
The report once again left off any items with a date of 2/29/08.


Double check the date field in the table to see if the 2/29
record(s?) have a time part. If the field is set using the
Now function or users might enter a time part, then it will
be after midnight on 2/29

A safer way to do that criteria would be:
= [Forms]![frmMonthlySelector]![StartDate] And
< [Forms]![frmMonthlySelector]![EndDate] + 1
 
B

Brendon

Does this still happen it happend to me to but now its not if it is ill try
to help!
 

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