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

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
 
J

John Spencer (MVP)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top