Results 1 to 6 of 6

Thread: Crystal - If Statement ? Very Basic

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    9

    Crystal - If Statement ? Very Basic

    Can someone tell where I would enter and structure an If Statement in Crystal to do the following. I am familiar with the statements but not sure where it would go.

    I have a Charge Amount and an Overide Amount. I want it to display the charge_amt field only when the overide_amt field is null.

    charge_amt and overide_amt are my fields

    thanks

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

    Re: Crystal - If Statement ? Very Basic

    Create a Formula field that returns the proper amount field. Then print/display the Formula field on the report. The Formula would contain the following

    Code:
    If IsNull({Your Table Name.Overide_Amt}) Then
       {Your Table Name.Charge_Amt}
    Else
       {Your Table Name.Overide_Amt}

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    9

    Re: Crystal - If Statement ? Very Basic

    Thank You Very Much. How can I modify this code so that if the Overide Column is null or = $0.00 ?

    If IsNull ({fox_trans_charge.override_amt}) Then
    {fox_trans_charge.charge_amt}
    Else
    {fox_trans_charge.override_Amt}

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

    Re: Crystal - If Statement ? Very Basic

    If IsNull ({fox_trans_charge.override_amt}) Or {fox_trans_charge.override_amt} = 0 Then
    ...

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    9

    Re: Crystal - If Statement ? Very Basic

    Thank You but that will just bring back the original data.

    Does this not have to be part of a Where Clause?

    Can you help me with that. thanks

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Crystal - If Statement ? Very Basic

    No, it goes into the report...

    It's been too long since I've made a report, but we do this kind of stuff all the time. Another thing you can do it to bring up the properties of the field and make its visibility conditional on any criteria you want.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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