IIF/Format equivalent in TSQL

Ask a Question related to Microsoft SQL / MS SQL Server, Design and Development.

  1. #1

    Default IIF/Format equivalent in TSQL

    Hi

    I have a client application that is currently connecting
    to MSAccess via ODBC. It uses the IIF and Format function
    in SQL-Statements. I want to migrate to SQL-Server. What
    equivalent functions do I have in T-SQL?

    thanks
    andi Guest

  2. Similar Questions and Discussions

    1. How you convert this cfquery to TSQL?
      Does anyone know how to convert this cfquery to TSQL? <cfquery name="test" datasource="abcinc"> select * from profiles where 0=0 <cfif...
    2. How u convert this cfquery to TSQL?
      Does anyone know how to convert this cfquery to TSQL? <cfquery name="test" datasource="abcinc"> select * from profiles where 0=0 <cfif...
    3. Using web services inside TSQL
      If you want to call a web service from SQL Server, you need to use the sp_OA* procedures to call the "interop assemblies" for the .NET web service....
    4. Is it possible to do this using TSQL instead of cursor ??
      I have a Tagdataminutely table with columns TagKey, datetime, Value, Quality and Rev. TagKey is not a primary key in this table, in fact this table...
    5. Please improve this TSQL algorithm ..
      Hi SQL Gurus, I have a big batch process in a stored procedure, i.e : a payroll process to calculate salary and all allowance should be received by...
  3. #2

    Default Re: IIF/Format equivalent in TSQL

    There is no IIF in SQL Server, you'll have to use CASE expression & perhaps
    CONVERT and other string functions instead of FORMAT.

    --
    - Anith
    ( Please reply to newsgroups only )


    Anith Sen Guest

  4. #3

    Default Re: IIF/Format equivalent in TSQL

    See CASE in the BOL for IIF

    See CONVERT or CAST for Format. (If I understand Format correctly.)

    Russell Fields
    "andi" <andi@nospam.com> wrote in message
    news:0b1701c33fd2$49f45fe0$a301280a@phx.gbl...
    > Hi
    >
    > I have a client application that is currently connecting
    > to MSAccess via ODBC. It uses the IIF and Format function
    > in SQL-Statements. I want to migrate to SQL-Server. What
    > equivalent functions do I have in T-SQL?
    >
    > thanks

    Russell Fields Guest

  5. #4

    Default Re: IIF/Format equivalent in TSQL

    see help on CASE function in BOL. it does the conditional matching of the
    resultset.

    --
    -Vishal
    "andi" <andi@nospam.com> wrote in message
    news:0b1701c33fd2$49f45fe0$a301280a@phx.gbl...
    > Hi
    >
    > I have a client application that is currently connecting
    > to MSAccess via ODBC. It uses the IIF and Format function
    > in SQL-Statements. I want to migrate to SQL-Server. What
    > equivalent functions do I have in T-SQL?
    >
    > thanks

    Vishal Parkar Guest

  6. #5

    Default Re: IIF/Format equivalent in TSQL

    Some info here:

    [url]http://www.aspfaq.com/2214[/url]
    [url]http://www.aspfaq.com/2460[/url]
    [url]http://www.aspfaq.com/2464[/url]




    "andi" <andi@nospam.com> wrote in message
    news:0b1701c33fd2$49f45fe0$a301280a@phx.gbl...
    > Hi
    >
    > I have a client application that is currently connecting
    > to MSAccess via ODBC. It uses the IIF and Format function
    > in SQL-Statements. I want to migrate to SQL-Server. What
    > equivalent functions do I have in T-SQL?
    >
    > thanks

    Aaron Bertrand - MVP Guest

  7. #6

    Default IIF/Format equivalent in TSQL

    thanks for all responses

    that helped
    andi Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139