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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Not Join Table

Status
Not open for further replies.

MattSmithProg

Programmer
Sep 9, 2001
76
AU
Hi,

I have two tables that have the same fields and structure.

What I want to do is to have a Select statement that returns all records based on a where clause. ie

Table1 Structure

ID, Yr, Allocate_Dt

Table2 Strucure

ID, Yr, Allocate_Dt

SELECT * From Table1, Table2 WHERE Table1.Allocate_Dt > '1899-12-30'

I want to return all of table2 and only the records in table1 which match the where clause in this format

ID, Yr, Allocate_Dt

Not

Id, Yr, Allocate_Dt, Id, Yr, Allocate_Dt

Any help would be greatly appreciated.

Thanks

Matt Smith No two nulls are the same
 

I think you want a Union query but am a little unclear on your requirement.

Select * From Table2
Union All
Select * From Table1
Where Table1.Allocate_Dt > '1899-12-30'

If this isn't what you need, please provide more info.

Thanks, Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Of course it is.

Sorry, I just had a complete block today. Friday arvo and all. No two nulls are the same
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top