Start and end dates give strange results in the report (1 Viewer)

hilian

Episodic User
Local time
Today, 05:17
Joined
May 17, 2012
Messages
130
I’m trying to have a report where the user can specify a reporting period. I set up a form with a command button to run the report and two text boxes for the user to enter the start and end dates. Then I added the following parameter in the date field of the query that feeds the report:

>=[Forms]![frmRptMenu]![txtSDate] And >=[Forms]![frmRptMenu]![txtEdate]

When I tested this, I got strange results. The report calculates a total sum spent over the reporting period. For the last two quarters of 2011, the amount was more than double what it should have been. When I tried the first two quarters of 2012, it gave errors in every field.

I took out the parameter and ran the report, and it ran correctly. Then I went back to the query, and in the criterion row I put:

Between [Enter start date] And [Enter end date]

It gave me correct totals. I want to use text boxes on a menu to control user entry, so I don’t want to stick with the simple parameter.

What am I doing wrong?

Thanks,

Henry
 

boblarson

Smeghead
Local time
Today, 05:17
Joined
Jan 12, 2001
Messages
32,059
Take a look at your signs. You have >= for BOTH the first should be that but the second should be <=
 

hilian

Episodic User
Local time
Today, 05:17
Joined
May 17, 2012
Messages
130
Thank you. I feel foolish, but I'm glad it not something much more complicated.

Henry
 

boblarson

Smeghead
Local time
Today, 05:17
Joined
Jan 12, 2001
Messages
32,059
No problem. Sometimes you can get so used to seeing what you've done it can be hard to spot even the simplest problems. A second pair of eyes usually helps with those types of problems.
 

hilian

Episodic User
Local time
Today, 05:17
Joined
May 17, 2012
Messages
130
I'm truly glad you spotted it. Thank you!
 

Users who are viewing this thread

Top Bottom