var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Query all records from one table LIKE records from another
I have a table1 that I want to see if there are records LIKE records from table2.
so the result set would return:
I tried joins but the results are entries that equal the values from table2.
What would the SQL statement be?
FROM Table1, Table2
WHERE (((Table1.Field1) Like [Table2]![Field1] & "*"))
ORDER BY Table1.Field1;
If you want to be specific:
WHERE (((tbl1.tbl1Data) Like "0001*")) OR (((tbl1.tbl1Data) Like "0003*")) OR (((tbl1.tbl1Data) Like "0005*"));
Buckeye's SQL will work (better) no matter what data you have and no matter how many records you have.
If you're using QBE, put both tables into the design - they don't have to be joined. Drag the Table1.Field1 to the grid, sort it ascending, and add the following to Criteria:
Like [Table2]![Field2] & "*"
Last edited by wazz; 01-05-05 at 19:10.