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!

Group by in Cr sets Order By in query designer

Status
Not open for further replies.

cclair

Programmer
Dec 27, 2001
3
US
I am working with CR8, using ASP and smartviewers. When I pass my where clause (by setting RecordSelectionFormula) I get an error because the report has grouping on it. Thus having an Order By before the Where clause. Any way around this?

I am passing one, none or many values in the where clause. Any help would be appreciated.

Thanks in advance.
 
I am surprised that using the selection formula get's the SQL out of sequence. However, here is one workaround.

Take the group field in that report, and create a new formula in the report that is just that one field. Then group on the formula instead of the field itself. This will make the grouping occur on the client (possibly a bit slower), but will not add any SQL for ORDER BY, because it can't pass the formula to the SQL statement.

Then you shouldn't have an ORDER BY in the way. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Will this change the display for the drill down on the smartviewer?
 
I can't see how changing the Group field from FieldX to a formula that is also FieldX would change the appearance of the report. It should only eliminate the ORDER BY in the SQL, which seems to be causing your error. Of course the only way to know for sure it to make the change and test it. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top