+ Reply to Thread
Results 1 to 3 of 3

Using MSQuery, IIF or Case

  1. #1
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Using MSQuery, IIF or Case

    Hi Guys, my first question.

    I'm using ms query to read Sage MMS Data. I'm reading SALES_TRANSACTIONS.TRANSACTION_TYPE which is returning 1, or 2, or 4, or 5. I want ms query to return either 6 or 7. if 1 then 7, if 2 then 6, if 4 then 6 else if 5 then 7.

    Any pointers would be welcome.

    Many thanks

    Chris

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Using MSQuery, IIF or Case

    My suggestion would be to return the {1, 2, 4, 5} in one column directly, and then use a second column next to it for processing like this:
    A1:A100 = TRANSACTION_TYPE
    B1 = IF( OR(A1 = 2, A1 = 4), 6, IF( OR(A1 = 1, A1 = 5), 7, "Exception"))
    pull down

    As a rule, External Data Connections just link to data and pull them back; do the processing/conversion on it once it's in excel.

    Especially if you're doing something lossy like this that can't be reversed without reconnecting to the original data anyways.

  3. #3
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Re: Using MSQuery, IIF or Case

    Thanks for the quick reply Ben.

    I'm coming to the conclusion that ms query, whilst being very clever is just for queries. If I want to do something with the data then the place to do it is in excel itself. I guess the clue is in the name ms query.

    Thanks anyway.

    Chris

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MSQuery question
    By LarryLL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2006, 06:05 PM
  2. MSQuery
    By Lac in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-14-2006, 03:55 AM
  3. MSQuery Optimization
    By BAC in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-03-2006, 04:00 PM
  4. Using Case in MSquery
    By LBIdydys in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2005, 12:10 AM
  5. need help with msquery query
    By jkendrick75 in forum Excel General
    Replies: 0
    Last Post: 04-25-2005, 10:06 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1