September 13, 2006 at 2:54 pm
I am trying to create a view where define a field as the first 100 characters of an NText type field. I get the error message "Data type error in expression"
Substring(NTEXT,1,100)
Documentation says Substring is valid for NText field types.
Any help?
September 13, 2006 at 3:10 pm
try this
Create
table ntexttest (sno int, val ntext)
Create View vw as
select
sno, Substring(val,1,100) as val from ntexttest
It is working fine for me
September 13, 2006 at 6:54 pm
What's wrong with LEFT(somentextval,100) ???
--Jeff Moden
Change is inevitable... Change for the better is not.
September 14, 2006 at 6:14 pm
you can use Left function also, but it won't accept ntext datatype,
you have to explicitly convert the datatype to character types
September 14, 2006 at 7:24 pm
Yah... forgot that the NTEXT data type is being used... sorry.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply