+ Reply to Thread
Results 1 to 2 of 2

Using Case in MSquery

  1. #1
    LBIdydys
    Guest

    Using Case in MSquery

    Is there a way to use case functionality in MSQuery like in tsql.
    Example
    Select Job,
    Case trantype
    when 1 then amount
    when 2 then amount *-1
    end as Amt
    from tblJob

  2. #2
    Ron Coderre
    Guest

    RE: Using Case in MSquery

    Try this:

    Select Job,
    (amount*CHOOSE(trantype,1 ,-1)) AS Amt
    from tblJob


    Does that help?

    ***********
    Regards,
    Ron

    XL2002, WinXP-Pro


    "LBIdydys" wrote:

    > Is there a way to use case functionality in MSQuery like in tsql.
    > Example
    > Select Job,
    > Case trantype
    > when 1 then amount
    > when 2 then amount *-1
    > end as Amt
    > from tblJob


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1