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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating and referencing Parameters

Status
Not open for further replies.

dstrange

Programmer
Nov 15, 2006
87
CA
I have created a report using 2 groups and a detail section which are displaying all records within my select criteria for the database fields that I set up. Now I would like to replace a field and change it to a parameter but I can't seem to get it to work.

I enter in my select statement (which is correct when I run it in mysql query browser) but how do I correctly insert a parameter into my WHERE clause. This is all done through:
Database Fields --> Database Expert --> Add Command
but I can't seem to figure out the correct syntax between the Select statment and the parameters I try to create.

The errors I get are:
Failed To open a rowset
 
Better to use Report > Selection Formulas > Report, it should let you insert fields OK. If you try something and it fails, please then post your formula.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
SQL Command Query For Database Fields:
SELECT Sum(If(IsNull(paid),0,paid) + If(IsNull(provided),0,If(paid>0,0,provided))) AS totalpaid,
Billing.method AS typepaid, Billing.date, Visits.exam9
FROM Visits RIGHT JOIN Billing ON Visits.prim_key = Billing.visit_num
WHERE date_Format(Billing.date,'%Y/%m/%d') BETWEEN {?date1} AND {?date2}
GROUP BY Billing.date, Visits.exam9, Billing.method



The report is grouped by date.
This is my formula for my Group:
CDate({Command.date}) in CDate({?date1}) to CDate({?date2})

I've noticed too that when I try to browse my data in CR that there is never any data to display. I have never worked with report grouping before. Do I have my Paramters setup incorrectly?
 
Thanks Madawc but I figured it out myself now.
 
dstrange,

So that this post can be helpful to others, please post your final command.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top