Sunday, March 25, 2012

Can I Edit the SQL Query in Crystal Report 9?

Hi,
Can I Edit the SQL Query in Crystal Report 9?
i just can see the SQL query at "Database"->"Show SQL Query". How do I edit it in Crystal Report?
thank you.In "Database"->"Database Expert".
Edit the command directly if you have a command, or a graphically if you have a list of tables and joins.|||In the "Database"->"Database Expert", i only see 2 tabs which are "Data" & "Links" (both are graphical).

i cannot see any "Edit" or the command.

BTW my CR version is 9.2.|||What exactly do you want to edit about the 'query'?
You add/remove tables in the Data tab, and change the joins in the Link tab - i.e. you do it graphically and the SQL query Crystal runs is altered appropriately.
You add data restrictions (where clause) in the Record Selection formula (Report menu, Selection Formulas, Record)|||Actually... I want to sort out and display the latest transaction to my report.

eg:
In my table:
Item CustOrder Price
A C1 1.90
A C1 2.10
A C1 2.00
B C8 33.90
B C8 32.00

In my report show:
Item CustOrder Price
A C1 2.00
B C8 32.00

So initially i want to use SQL Statement "Group By" clause to sort it out and display, but later i found it got some problem / the record displayed is not correct.

any idea? or what can i do?

thank you.|||Then your SQL is fine; you want to use the Group Expert to group on the column that contains the 'A', 'B' etc. values and then the column for the 'C1', 'C8' etc. values. You might then want to use the Record Sort Expert to order the records within these groups (e.g. is there a timestamp to order them in 1.90, 2.10, 2.00 order?) and display the row you want in the group footer (i.e. suppress the detail).

No comments:

Post a Comment