CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2006
    Posts
    4

    Question 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.

  2. #2
    Join Date
    May 2006
    Posts
    324

    Re: Can I Edit the SQL Query in Crystal Report 9?

    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.

  3. #3
    Join Date
    Jul 2006
    Posts
    4

    Re: Can I Edit the SQL Query in Crystal Report 9?

    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.

  4. #4
    Join Date
    May 2006
    Posts
    324

    Re: Can I Edit the SQL Query in Crystal Report 9?

    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)

  5. #5
    Join Date
    Jul 2006
    Posts
    4

    Re: Can I Edit the SQL Query in Crystal Report 9?

    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.

  6. #6
    Join Date
    May 2006
    Posts
    324

    Re: Can I Edit the SQL Query in Crystal Report 9?

    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured