Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Union Query Experiment 1

Status
Not open for further replies.

cheiboy

Technical User
May 9, 2003
96
CA
Below is my experiment for a union query, never done this before.

SELECT [PLAN_ID], [RECVD_DT] FROM MEMBER

UNION SELECT [PLAN_ID], [RECVD_DT] FROM UM MEMBER

ORDER BY [RECVD_DT];

I get a message saying the UM doesn't exist. Any ideas anyone?
 
is your second table called UM MEMBER? If it is, I would rename in UM_MEMBER and put that in your query. It is good practice to not use spaces in table names, and column names. It just makes things easier.

Dodge20
 
Worked, I renamed the table to UMMEMBER, now, what if I want to pull my info by date?
 
you just have to put a where clause in your select statements.

SELECT [PLAN_ID], [RECVD_DT] FROM MEMBER
WHERE [RECVD_DT] = whatever_date
UNION
SELECT [PLAN_ID], [RECVD_DT] FROM UM MEMBER
WHERE [RECVD_DT] = whatever_date

ORDER BY [RECVD_DT];


Dodge20
 
Worked again, Thanks. My dates are pulled using a start date and a end date for monthly reports. Sorry about, I should have mentioned that somewhere.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top