ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Data From Two tables using SQL (https://www.excelbanter.com/excel-programming/312771-data-two-tables-using-sql.html)

soniya

Data From Two tables using SQL
 
Hi All,

Is it possible to get data from two tables to a single
sheet using sql?

Both tables do have several same fields but not all.

TIA

Soniya

keepITcool

Data From Two tables using SQL
 
Soniya, try using the UNION keyword


select * from Table1 where Field1 = 'criteria'
union
select * from Table2 where Field1 = 'criteria'





You'll find a handy reference to SQL for JET
on
http://www.devguru.com/Technologies/...sql_intro.html


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Soniya" wrote:

Hi All,

Is it possible to get data from two tables to a single
sheet using sql?

Both tables do have several same fields but not all.

TIA

Soniya




All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com