Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004

    Unanswered: IIf in Query question

    I am attempting to execute the following query but am getting syntax errors.
    I don't have a lot of practice with the IIf function, need help.
    Any Ideas??

    UPDATE View_Data SET
    Num_07 = Num_01/IIf(Den_01=0,1,Den_01)
    where Data_Set_ID = 444

    Server: Msg 170, Level 15, State 1, Line 2
    Line 2: Incorrect syntax near '='.

    More Info
    The fields Num_07,Num_01, Den_01 are all of type 'float'
    Last edited by mattryan; 08-04-04 at 15:10.

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    I think that you need to replace the Jet/VB Iif() with the SQL Server CASE statement.


Posting Permissions

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