SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Joining Tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

robone
Starting Member

United Kingdom
5 Posts

Posted - 02/19/2007 :  10:56:40  Show Profile  Reply with Quote
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

United Kingdom
168 Posts

Posted - 02/19/2007 :  12:23:16  Show Profile  Visit Antonio's Homepage  Reply with Quote
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

United Kingdom
5 Posts

Posted - 02/20/2007 :  07:00:22  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000