UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Append A Number To A Nchar    
 
   
cdavidsn
post Apr 17 2012, 12:24 PM
Post #1

UtterAccess Ruler
Posts: 1,122
From: Mississippi USA



I have two fields, one is an integer and the other is a nchar(10). I need to take what is in the int field and append it to the nchar field. How would I go baout doing that. Here is a sample of the data I am looking to join up.

nchar Int new nchar
1-52- 3 1-52-3
1-126- 1 1-126-1
1-78- 79 1-78-79

Thanks for any assistance that can be provided.
Go to the top of the page
 
+
datAdrenaline
post Apr 17 2012, 01:33 PM
Post #2

UtterAccess Editor
Posts: 15,970
From: Northern Virginia, USA



You can use the CAST() T-SQL function to cast your int into an nchar ...

SELECT f1, f2, f1 + CAST(f3 AS nchar) As newNChar FROM someTable
Go to the top of the page
 
+
cdavidsn
post Apr 17 2012, 02:22 PM
Post #3

UtterAccess Ruler
Posts: 1,122
From: Mississippi USA



I created a new field fo type varchar and Casted the fields that way. Thanks for the assistance.

This post has been edited by cdavidsn: Apr 17 2012, 02:22 PM
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 01:06 PM