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.
| Author |
Topic |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2008-01-08 : 11:34:51
|
| How to concatenate a real datatype field to a varchar.rf.SequenceNO is a real datatype field i am concatenating below.select rfid, (select 'RF' + EnglishText from Tab_picklists where fieldlabelkey='lblRFType' and pickid=RF.RFType) + ' - ' + rf.SequenceNO as RFRecord from Tab_RF RF where rf.contractid=17Thank you very much for your help. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-01-08 : 12:55:10
|
| Try with CAST function and see if it preserves the accuracy.select rfid, (select 'RF' + EnglishText from Tab_picklistswhere fieldlabelkey='lblRFType' and pickid=RF.RFType) + ' - ' + CAST(rf.SequenceNO as varchar(x)) as RFRecord from Tab_RF RF where rf.contractid=17x will be max length of real value field |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-09 : 02:10:42
|
quote: Originally posted by cplusplus How to concatenate a real datatype field to a varchar.rf.SequenceNO is a real datatype field i am concatenating below.select rfid, (select 'RF' + EnglishText from Tab_picklists where fieldlabelkey='lblRFType' and pickid=RF.RFType) + ' - ' + rf.SequenceNO as RFRecord from Tab_RF RF where rf.contractid=17Thank you very much for your help.
Most likely this is formation that should be done in your front end application, if usedMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|