SQL Server Case

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JeremieSimonsen
    New Member
    • May 2007
    • 1

    SQL Server Case

    Good Afternoon All,

    I have the following IIF statement that I need duplicated in SQL. I'm new to SQL so any help will be greatly appreciated.

    Field2: IIf(IsNull(live 53_OPCCSMS!CUST _CLASS_CODE),"0 ",LTrim(CStr(li ve53_OPCCSMS!CU ST_CLASS_CODE)) )
  • almaz
    Recognized Expert New Member
    • Dec 2006
    • 168

    #2
    [CODE=sql]ISNULL(LTRIM(CU ST_CLASS_CODE), '0')[/CODE]

    Comment

    • Vidhura
      New Member
      • May 2007
      • 99

      #3
      Use case statement
      case when IsNull(live53_O PCCSMS!CUST_CLA SS_CODE) then 0 else LTrim(CStr(live 53_OPCCSMS!CUST _CLASS_CODE)) end

      Comment

      Working...