Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Joing Multiple Columns
Hi All,

Bit of a newbie question i'm afraid, so sorry if this is a really
stupid question,

I am not sure if I am trying to do this in the right place as I am sure
SQL Server has a far better way of doing this

What I am trying to do is join the contents of several columns and
present the entry into a new column. the entries of all the columns I
am trying to join are different types such as dates and numbers. I want
to join all columns as a text string. To make it just a even more
tricky I wish to insert a # between all fields.

Just in case my poor description has got you thinking What the F*&K
here is an example of what I am trying to do

C1    C2	  C3	     C4	            C5
Ian   1234  22/02/2006   123456789 Ian#1234#22/02/2006#1234567890
I have been trying to do this in the Formula in the design veiw of the
table.

Any Advice would be fantastic.


Many Thank

Ian


Report this thread to moderator Post Follow-up to this message
Old Post
Crumb
02-25-06 02:45 PM


Re: Joing Multiple Columns
Try:

select
C1 + '#' + cast (C2 as varchar (10)) + '#' + convert (char (10), C3,
103) + '#' + cast (C4 as varchar (10))
from
MyTable

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON   Canada
www.pinpub.com
.
"Crumb" <rowan.ian@gmail.com> wrote in message
news:1140655591.245227.133490@f14g2000cwb.googlegroups.com...
Hi All,

Bit of a newbie question i'm afraid, so sorry if this is a really
stupid question,

I am not sure if I am trying to do this in the right place as I am sure
SQL Server has a far better way of doing this

What I am trying to do is join the contents of several columns and
present the entry into a new column. the entries of all the columns I
am trying to join are different types such as dates and numbers. I want
to join all columns as a text string. To make it just a even more
tricky I wish to insert a # between all fields.

Just in case my poor description has got you thinking What the F*&K
here is an example of what I am trying to do

C1    C2   C3      C4             C5
Ian   1234  22/02/2006   123456789 Ian#1234#22/02/2006#1234567890
I have been trying to do this in the Formula in the design veiw of the
table.

Any Advice would be fantastic.


Many Thank

Ian


Report this thread to moderator Post Follow-up to this message
Old Post
Tom Moreau
02-25-06 02:45 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 05:38 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006