SQL Query - Join or Subquery
Posted on 2008-06-20
Two tables, one called tblOffice the other called tblFactory.
Both tables have the following fields. FirstName, LastName, Birthday
I need to combine (join) both tables where the Birthday = today's date.
vDate = Date()
vSQL = ""
vSQL = vSQL & " SELECT o.FirstName, o.LastName, 0.Birthday, f.FirstName, f.LastName, f.Birthday "
vSQL = vSQL & " FROM tblOffice o "
vSQL = vSQL & " CROSS JOIN tblFactory f "
vSQL = vSQL & " WHERE o.Birthday = '" & vDate & "' OR f.Birthday = '" & vDate & "' "
Cross join does not appear to be producing the correct results.