+ Reply to Thread
Results 1 to 4 of 4

IF or CASE in SQL on Excel Sheet

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    IF or CASE in SQL on Excel Sheet

    Using VBA in
    Excel 2016 64 bit
    with
    Microsoft.ACE.OLEDB.12.0

    Can query 97-2003 Excel File (.xls)
    successfully with simple
    Please Login or Register  to view this content.
    But I need to add
    Please Login or Register  to view this content.
    OR
    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: IF or CASE in SQL on Excel Sheet

    Does this work?

    Iif(Field3 = 'A' Or Field3 = 'B', 'RED', 'BLUE') AS 'COLUMNNAME
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: IF or CASE in SQL on Excel Sheet

    It does, thank you. I thought IFF only worked on Access.

    Do you know of a source for comprehensive information of Excel SQL syntax? I can't find one.3

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: IF or CASE in SQL on Excel Sheet

    I don't think there is such a thing, as far as I'm aware when querying an Excel file you would use 'standard' SQL.

    You can however use some VBA functions, e.g. Iif.

+ 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. Case Management Excel Sheet
    By Markel in forum Excel General
    Replies: 2
    Last Post: 06-14-2012, 05:51 AM
  2. Replies: 2
    Last Post: 05-16-2006, 12:10 PM
  3. [SOLVED] How to change mixed case to upper case in Excel for all cells
    By WordAlone Network in forum Excel General
    Replies: 6
    Last Post: 02-14-2006, 08:10 PM
  4. excel'03 how to convert a column from upper case to proper case
    By sharie palmer in forum Excel General
    Replies: 1
    Last Post: 01-30-2006, 07:55 PM
  5. Excel: How do I change all upper case ss to proper case?
    By Moosieb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-12-2006, 08:50 PM
  6. Replies: 2
    Last Post: 12-09-2005, 05:15 AM
  7. How do I change a column in Excel from upper case to lower case?
    By Debbie Kennedy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-02-2005, 02:06 PM
  8. TURN LOWER CASE TO UPPER CASE IN EXCEL?
    By TommyG in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2005, 10:25 PM

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