Professional Web Applications Themes

IIF/Format equivalent in TSQL - Microsoft SQL / MS SQL Server

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...

  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. #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

  3. #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" <andinospam.com> wrote in message
    news:0b1701c33fd2$49f45fe0$a301280aphx.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

  4. #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" <andinospam.com> wrote in message
    news:0b1701c33fd2$49f45fe0$a301280aphx.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

  5. #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" <andinospam.com> wrote in message
    news:0b1701c33fd2$49f45fe0$a301280aphx.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

  6. #6

    Default IIF/Format equivalent in TSQL

    thanks for all responses

    that helped
    andi Guest

Similar Threads

  1. How you convert this cfquery to TSQL?
    By roofusthedoofus in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: February 23rd, 01:25 PM
  2. How u convert this cfquery to TSQL?
    By roofusthedoofus in forum Coldfusion Database Access
    Replies: 2
    Last Post: February 22nd, 09:13 PM
  3. Using web services inside TSQL
    By SriSamp in forum Microsoft SQL / MS SQL Server
    Replies: 5
    Last Post: July 24th, 11:43 AM
  4. Is it possible to do this using TSQL instead of cursor ??
    By Ricky in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 7th, 05:50 PM
  5. Please improve this TSQL algorithm ..
    By Krist Lioe in forum Microsoft SQL / MS SQL Server
    Replies: 0
    Last Post: June 30th, 08:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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