Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Range Parameter in Crystal 10 shows differently in SQL

Status
Not open for further replies.

rose4567

Programmer
Mar 12, 2007
70
US
I create two paramaters for date range.

"startcheckdate" and
"endcheckdate"

I used them to calculate a date range on a payment date field.

In my main report, I have the above two parameters. And I have two formulas. The formulas are name the same and just have the parameter field in each of them. I use the formulas to pass the values from parameters into two subreports.

In each subreport, the formula for payment date looks like:
{invoice_hdr.payment_date} in {?pm-@startchkdate} to {?pm-@endchkdate}

Something is happening I've never seen before and I'm wondering if anyone else has run across this.

I enter the date range 1/1/2007 - 1/31/2007 and it shows on the report fine. But if I click "database" and "view sql" the startcheck date shows up at 1/2/2007. It doesn't matter what start date I use and it doesn't matter if I enter the dates directly into the subreport parameters. It jumps one day forward in the SQL syntax everytime. Causing the data to be incorrect in my report since the date range is off.

Has anyone seen this before? Perhaps I did not set up my parameters correctly to pass values into the subreports? Any thoughts would be so helpful. Thank you all in advance!
 
Not seen this before but you may be better off if you create parameters with same name in your subreports. and then link parameters from main report to subreport.

Select Parameter in main report and then in bottom left hand corner select same parameter from drop down list.

Also try changing select statement to

{invoice_hdr.payment_date} >= {?startchkdate} and
{invoice_hdr.payment_date} <={?endchkdate}

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top