Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Joining Tables

Author  Topic 

robone
Starting Member

5 Posts

Posted - 2007-02-19 : 10:56:40
Hi,

Not sure if this as straight forward as it sounds!

Everytime I create new fields on our DB it creates new tables(our customer units have changed). What I need to do is pull the customer units from both tables into the same column. Is there a way to do this?

Thanks

Rob

Antonio
Posting Yak Master

168 Posts

Posted - 2007-02-19 : 12:23:16
quote:
Originally posted by robone

Hi,

Not sure if this as straight forward as it sounds!

Everytime I create new fields on our DB it creates new tables(our customer units have changed). What I need to do is pull the customer units from both tables into the same column. Is there a way to do this?

Thanks

Rob





Please explain the highlighted text in SQL Server speak.

Everytime I create new fields on our DB it creates new tables(our customer units have changed). What I need to do is pull the customer units from both tables into the same column. Is there a way to do this?


_________________________________________________________________________________________________________________________
Inability is a disaster; patience is bravery; abstinence is a treasure, self-restraint is a shield; and the best companion is submission to Divine Will.
Go to Top of Page

robone
Starting Member

5 Posts

Posted - 2007-02-20 : 07:00:22
Hi Antonio,

On the DB we use, whenever I have to change fields on the front end of the system. It creates a new table in the back end(SQL). I have had to change our customer units and where they were on a table called Actioncustomtxt1.Cu_value1, the new Customer units are on a table called Actioncustomtxt10.Cu_value4.

select Action.An_Reference, Actioncustomtxt7.Cu_value2, Actioncustomtxt1.Cu_Value4,
Actioncustomtxt10.Cu_value1, Actioncustomtxt1.cu_value1 as OldSolutionunit,Actioncustomtxt10.cu_value4 as Newsolutionunit,
Actioncustomtxt10.Cu_value2, dateadd(day,Request.RQ_datesubmitted,'01/01/1900') as Datesubmitted,
dateadd(Day,Action.An_Startdate,'01/01/1900') as Startdate, dateadd(day,Action.An_enddate,'01/01/1900') as Enddate, action.Pr_code, Actioncustomtxt6.Cu_value5,
Action.At_code, request.Re_code, Res.RE_desc, Request.Rq_assignedmandays,actioncustomnum1.cu_value1,
Actioncustomnum1.Cu_value7,Actioncustomnum1.Cu_value9
From Action inner join Request on Request.An_Key = Action.An_Key
inner join Actioncustomtxt7 on Actioncustomtxt7.An_key = Request.AN_Key
inner join Actioncustomtxt1 on Actioncustomtxt1.An_key = Request.An_Key
inner join Actioncustomtxt10 on Actioncustomtxt10.An_Key = Request.An_Key
inner join Actioncustomtxt6 on Actioncustomtxt6.An_key = Request.An_Key
inner join Actioncustomnum1 on Actioncustomnum1.An_key = Request.An_key
Inner join Res on Res.Re_code = Request.Re_code

What I need to do is pull from both fields, so that the data is pulling into one column, is this possible, or what would be the best way of doing it.

Thanks

Go to Top of Page
   

- Advertisement -