Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Location
    Frankenmuth, MI
    Posts
    21

    Unhappy Unanswered: Check If variable is Null......

    In my one trigger, I create two variables after using some for getnames statements and returning some values from a couple of my tables.

    I am then, using those values to populate a summary table, but there are instances where the one value is null which means that I dont need to input it into my summary table.

    What's the syntax for an if statement with an isnull function?

    TIA

  2. #2
    Join Date
    Aug 2003
    Location
    Massachusetts, USA
    Posts
    106

    Re: Check If variable is Null......

    One way:

    IF variable IS NULL THEN

    or if you have unexpected results, you can try the below

    IF (COALESCE(variable,-1) = -1 THEN

    If the variable is null, then a -1 is substituted else the value of variable is returned.



    Originally posted by putts
    In my one trigger, I create two variables after using some for getnames statements and returning some values from a couple of my tables.

    I am then, using those values to populate a summary table, but there are instances where the one value is null which means that I dont need to input it into my summary table.

    What's the syntax for an if statement with an isnull function?

    TIA

Posting Permissions

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