Author |
Topic |
desikankannan
Posting Yak Master
152 Posts |
Posted - 2011-01-27 : 06:26:35
|
hi try to convert int to char in a querycast((ht_booknew.bookingno1+'-'+ht_booknew.bookingno2),VAR(200)) as bookingnobut it throws the errorMsg 195, Level 15, State 10, Line 1'varchar' is not a recognized built-in function name.Desikankannan |
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-01-27 : 06:36:11
|
Replace with cast((ht_booknew.bookingno1+'-'+ht_booknew.bookingno2) as VARCHAR(200)) as bookingno |
 |
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2011-01-27 : 06:46:38
|
hi,again its throwing error likeArithmetic overflow error converting varchar to data type numeric.quote: Originally posted by MIK_2008 Replace with cast((ht_booknew.bookingno1+'-'+ht_booknew.bookingno2) as VARCHAR(200)) as bookingno
Desikankannan |
 |
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2011-01-27 : 06:49:06
|
hi this is my queryselect cast((ht_booknew.bookingno1+'-'+ht_booknew.bookingno2) as varchar(300))as bookingno from ht_booknewerror throwingMsg 8115, Level 16, State 6, Line 1Arithmetic overflow error converting varchar to data type numeric.quote: Originally posted by MIK_2008 Replace with cast((ht_booknew.bookingno1+'-'+ht_booknew.bookingno2) as VARCHAR(200)) as bookingno
Desikankannan |
 |
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-01-27 : 06:57:02
|
1) What are the datatypes of the BookingNo1 and No2 fields? Seems to be Numeric with the length of? 2) are you trying to concat the BookingNo1 and BookingNo2 fields, separating both with a -? |
 |
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2011-01-27 : 07:43:24
|
quote: Originally posted by MIK_2008 1) What are the datatypes of the BookingNo1 and No2 fields? Seems to be Numeric with the length of? 2) are you trying to concat the BookingNo1 and BookingNo2 fields, separating both with a -?
Desikankannan |
 |
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2011-01-27 : 07:44:47
|
yes i tryint to concat the bookingno1 and bookingno2 fieldsquote: Originally posted by MIK_2008 1) What are the datatypes of the BookingNo1 and No2 fields? Seems to be Numeric with the length of? 2) are you trying to concat the BookingNo1 and BookingNo2 fields, separating both with a -?
Desikankannan |
 |
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-01-27 : 07:52:51
|
Go with the following :)Select cast (ht_booknew.bookingno1 as varchar(100))+ ' - ' + cast(ht_booknew.bookingno2 as varchar(100)) as bookingnofrom ht_booknew |
 |
|
|