Results 1 to 2 of 2

Thread: Complex SQL

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Posts
    72

    Angry

    I am trying run an SQL in code to access a SQL server.

    Anyone know how you UNION 2 SQLs in one call?

    thnks
    VB 6 Professional Edition

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Just separate them with the UNION keyword. The datatypes and number of fields returned must match in both (or how ever many) queries. Save any Order By clauses for the end and refer to the fields by number (i.e. 'Order By 2' ).

    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

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



Click Here to Expand Forum to Full Width