Results 1 to 9 of 9

Thread: Problem with formula

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Problem with formula

    Hi to All:

    First of all i'm newbie with CR and his formulas...

    I have this little code in crystal reports in one formula:

    Code:
    if {lancamentos.livro}="Venda de Mercadorias" then
    sum ({lancamentos.txredvaloriva})
    The code reconize the instructions the problem is that sum sum all the records,in the field lancamentos.txredvaloriva,but I just want the instruction sum sum the records that be "Venda de Mercadorias"...

    Any suggestion please?

    Thanks

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Problem with formula

    I don't know that much about CR Forumlas, but do they support a WHERE clause?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Problem with formula

    Hi:

    I think so not...It was easy if the CR had a Where clause like SQL!
    In fact I don't know the way to resolve this!!

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Problem with formula

    Are you using a frontend for your program?

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Problem with formula

    Crystal generates the Where clause based on the information in the Record Selection formula (Report -> Edit Selection Formula -> Record menu). You don't need the If statement just the following

    {lancamentos.livro}="Venda de Mercadorias"

    As for the Sum, the easiest way is to add the database field onto the report. Then Right-Click on that object, select the Insert menu item and then the required summary that you want to perform.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Problem with formula

    Hi:

    And don't know the way to insert from database the field into the report...
    I think you refer to the field "txredvaloriva" right?

  7. #7
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Wink Re: Problem with formula

    Quote Originally Posted by sacramento
    Hi:

    And don't know the way to insert from database the field into the report...
    I think you refer to the field "txredvaloriva" right?
    You should see a Field Explorer to the left (unless you have meddled with the default settings). If it is not visible click View->Field Explorer. You should find several entries click the one which says Database Fields. This should open all the tables/views you have added (Linked) to the CR. Click further the reqd T/V you should find all the Fields of the T/V. Now pull the Field you want to summarize

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Problem with formula

    ok...Thanks

  9. #9
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: Problem with formula

    welcome

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