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

Need Help!

Status
Not open for further replies.

vngpal

Programmer
Jan 14, 2004
35
US
Hello All,
I need help to solve this issue. The issue is as below.
I have a table A with few fields like day1, day1_Source and so on. The day1_Source field contains various values.
I have another table B with lot of field names and some of the filed names are as per the values in table A day1_Source.
I want to select the values from table B fields based on the table A day1_Source values.
For eaxmple table A is as follows
day1 day1_Suorce
01 b.begin_date
02 b.end_date

Table B is as below.
cust_code begin_date end_date
001 04-01-2005 03-31-2006
002 12-12-2000 05-02-2003


Is there a way I can get all the values from begin_date from table B if table A day1_source is b.begin_date and like all values from end_date from table B if day1_source is b.end_date.

Appreciate your help.

Thanks,
vngpal
 
You should do an Insert Select:

Example:
Insert TableA(whatever fields)
Select (TableB fields needed to insert into tableA)
From TableB
Where (whatever conditions you want to apply.)


With Great Power Comes Great Responsibility!!! [afro]

Michael
 
Thanks for the reply.

Let me give a shot.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top