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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 lenght

Author  Topic 

cwtriguns2002
Constraint Violating Yak Guru

272 Posts

Posted - 2007-10-08 : 04:39:16
hi all...

mycount = (cast(d.sss_er as varchar)).len

sss_er is a datatype money

error : Cannot call methods on varchar.

thanks

RON
________________________________________________________________________________________________
"I won't last a day without SQL"




SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-08 : 04:41:21
mycount = len(cast(d.sss_er as varchar))



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-08 : 06:12:05
quote:
Originally posted by Peso

mycount = len(cast(d.sss_er as varchar(50)))



E 12°55'05.25"
N 56°04'39.16"




Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-08 : 06:16:18
quote:
Originally posted by cwtriguns2002

hi all...

mycount = (cast(d.sss_er as varchar)).len

sss_er is a datatype money

error : Cannot call methods on varchar.

thanks

RON
________________________________________________________________________________________________
"I won't last a day without SQL"







What are you trying to do?
If you convert money to varchar, you will get wrong length



declare @m money
set @m=345345
select len(cast(@m as varchar(50)))


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -