Click to See Complete Forum and Search --> : SEEK/FIND


midnightservice
September 4th, 2001, 06:50 AM
i have a database with 3 forms covering different data... i wont to create a main search that will search all 3 tables ta once and return the corresponding search...in a new table with all the info from the table related to the search any ideas, or examples of this.....

midnightservice
thanks in advance

Iouri
September 4th, 2001, 07:03 AM
Try to use join to search all 3 tables.

Iouri Boutchkine
iouri@hotsheet.com

Cakkie
September 4th, 2001, 09:50 AM
You can combine multiple select statements using the UNION keyword. Note that all select statements must return the same amount of columns, and that the datatypes of the columns in the different tables matches.

SELECT ColumnA, ColumnB, ColumnC
FROM TabelA
WHERE ColumnA Like '*VBCodeLibrary*'

UNION

SELECT ColumnA, ColumnB, ColumnC
FROM TabelB
WHERE ColumnA Like '*VBCodeLibrary*'

UNION

SELECT ColumnA, ColumnB, ColumnC
FROM TabelC
WHERE ColumnA Like '*VBCodeLibrary*'



Here I matched them up using the same condition, but you can create a different WHERE clause for each select statement.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook