SQL Union Query

S

sunilkeswani

Hi,

I have a database which is used by 200 users, because of this, it is 20
different access files, and I have to make one master query, which
would union all the tblMain.

How do I get an SQL query to display only yesterday's, or last 7 days,
or this month's data.

I have

SELECT * from tblData UNION Select* from tblData1 UNION Select* from
tblData2 UNION Select* from tblData3 UNION Select* from tblData4 UNION
Select* from tblData5 UNION Select* from tblData6 UNION Select* from
tblData7

How do I insert the "WHERE" with the option Date()-1 ?

Any help would be appreciated.

Cheers

Sunny
 
G

Guest

I have a database which is used by 200 users
How does this relate?
it is 20 different access files
Your query has only 8 tables.
How do I get an SQL query to display only yesterday's, or last 7 days, or this month's data.
How do I insert the "WHERE" with the option Date()-1 ?
I recommend you build a select query using one table, open it in design view
and add criteria for YESTERDAY -- Date()-1 and test it.

Then you can click on menu VIEW - SQL View and edit to make it a union query.

Another way is the create your union query then use it as data source in a
select query with your criteria.

Build a little, test a little.
 

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

Top