Results 1 to 3 of 3
  1. #1
    Xarkath is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Millcreek WA
    Posts
    92

    Union Query fields

    Hello,



    When buiding a Select statment in a Union Query is it possible to reference the column numbers instead of the column headers. If so, what would be the correct syntax? I tried to Google this but I could not find anything on it.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Never heard of this and I doubt can do this in query. AFAIK, index referencing is VBA. As evidenced by the fact queries will not recognize combo or list box column index.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I don't think that is possible. The closest I recall is in Order By which works in Access.

    example
    Code:
    SELECT last_name, department_id, salary 
       FROM employees 
       ORDER BY 2 ASC, 3 DESC, 1;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 03-06-2014, 02:41 PM
  2. Replies: 1
    Last Post: 02-27-2014, 07:59 PM
  3. Format two fields in a Union Query as Currency
    By alansidman in forum Queries
    Replies: 1
    Last Post: 12-14-2012, 12:41 PM
  4. Replies: 14
    Last Post: 11-09-2012, 01:19 PM
  5. Union Query (choosing between two fields)
    By naveehgreen in forum Programming
    Replies: 1
    Last Post: 06-17-2010, 03:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums