Results 1 to 4 of 4

Thread: function

  1. #1
    Join Date
    Mar 2008
    Posts
    29

    Smile Unanswered: function

    hi,
    Is there any function to use (if, elseif, else). In the select command only i have to use that function. IIF function we can use ( if, else).

    for ex:
    we can use IIF function as
    SELECT IIF(TYPE = 'T', 1, 0) FROM TABLE NAME;
    Using IIF we had 2 options only.
    But i had 3 options how i can use in select command.

    Any help plese.
    Thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi Suni

    1) You can nest Iif
    2) You could also look up the syntax for Switch - easier to use than nested Iifs
    3) IMHO, assuming your example is representative of your problem, this should be in a table:
    http://weblogs.sqlteam.com/jeffs/arc...2/10/9002.aspx
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    Try next;
    IIf([fieldName]="T";1;IIf([fieldName]="B";3;0))

    adapt it as you need.

  4. #4
    Join Date
    Mar 2008
    Posts
    29

    Smile Thanks

    Thank you very much to all.I got it.

Posting Permissions

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