Same data from 2 sources

D

DS

I need to pull the same data from 2 databases, the both have the same
tablenames. just the history one has data in it older than a year.

This is what I have, it works fine for the current db...
It works fine for the history db, but the problem is when I need data
from both.

Me.RecordSource = "SELECT tblChecks.ChkBizDay, [EmpFirstName] & "" "" &
[EmpLastName] AS EMP, " & _
"tblChecks.ChkDate, tblChecks.ChkTime, tblChecks.CheckID, " & _
"tblChecks.ChkAlias, tblChecks.ChkCancelled, tblChecks.ChkKillID,
tblChecks.ChkTotal " & _
"FROM tblChecks LEFT JOIN tblEmployees ON tblChecks.ChkServer =
tblEmployees.EmployeeID AND IN '//Backoffice/Warehouse/History.mdb' " &
"WHERE (((tblChecks.ChkBizDay) >=
[Forms]![frmReportDates]![TxtStart] " & _
"And (tblChecks.ChkBizDay) <= [Forms]![frmReportDates]![TxtEnd]) " & _
"And ((tblChecks.ChkCancelled) = -1) And ((tblChecks.ChkKillID) = 0)) " & _
"ORDER BY [EmpFirstName] & "" "" & [EmpLastName], tblChecks.ChkDate,
tblChecks.ChkTime;"

Thanks
DS
 
J

John Spencer

You might try a UNION query although it may fail with having two In clauses.



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

UNION QUERY (Sorting) 2
UNION SELECT Problem 2
From External Database 5
Joining 2 Queries 3
UnMatched Query 3

Top