Cast( left( remark, 50) as varchar(50))

  • Thread starter Thread starter pol
  • Start date Start date
P

pol

is there any select statement as follows

Cast( left( remark, 50) as varchar(50))
from remarktable;

I want to change the datatype from text into varchar in select statement

With thanks

Pol
 
Where are you attempting to do this? In Access with standard Access SQL,
ANSI92 SQL, as a pass-through query to MS SQL Server?

In standard Access SQL, you might want to use something like the following.

SELECT Trim(LEFT(Remark,50)) as Remark50
FROM RemarkTable

LEFT would get the leftmost 50 characters, and Trim would remove any leading
or trailing spaces on the returned 50 characters. You could use RTrim if you
wanted to just remove trailing spaces.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top