Link to home
Start Free TrialLog in
Avatar of pgooseman
pgooseman

asked on

SQL Query - Join or Subquery

 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.

      DIM vDate       
      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.
ASKER CERTIFIED SOLUTION
Avatar of asafadis
asafadis
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial