Results 1 to 7 of 7

Thread: How to execute SQL Statement in Crystal Reports Formula?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    14

    How to execute SQL Statement in Crystal Reports Formula?

    How to execute SQL Statement in Crystal Reports Formula?

    I'm using Crystal Reports 8.x and I've a summary report which I want to insert a field into it. This field is not in the field list but I want to take it from the database table. So that's the reason why I want to execute the SQL Statement in the Crystal Report Formula.

    Is it posible to do that? If it's possible to do, could you please show me how?

    Thanks so much,
    Sirisak K.

    PS! I don't want to generate the complicate query for that field. But I want to use Crystal Report Formula to get it from the database table directly.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    You can't execute a query in a Formula. Your best bet might be to add a subreport.

  3. #3
    Fanatic Member SkiNLaB's Avatar
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    747
    not sure if CR8 has sql expression fields, but in CR9 this is what you would be after i think. its in the field explorer window. just pop ur sql statement in there.

  4. #4
    Lively Member Joffies's Avatar
    Join Date
    Aug 2002
    Location
    London
    Posts
    119
    Is this field in another table or in the existing table ? If this field is in the existing table just validate your report against the database and it should show the field in the field explorer. Otherwise add the table or like bruce says use a subreport.

    How can you use the sql expression option with tables or fields that are not include in the report.?
    Do, or do not. There is no 'try'.

  5. #5
    Fanatic Member SkiNLaB's Avatar
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    747
    magic

  6. #6
    Lively Member Joffies's Avatar
    Join Date
    Aug 2002
    Location
    London
    Posts
    119
    Magic..mmm..like pulling a rabbit out of a hat you mean..?
    Do, or do not. There is no 'try'.

  7. #7
    Fanatic Member SkiNLaB's Avatar
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    747
    Select Rabbit FROM Hat WHERE RabbitInside = False ORDER BY Rabbit

    TaDa, Recordcount = 1

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