Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesWhat is the correct syntax for querying the first 20 characters of a memo field? I'm trying to SELECT CAST (varchar(20) fieldname) as newfieldname and i get a bunch of errors Can someone please help me? MS Access DB used with ColdFusion Thanks
Post Follow-up to this messageI don't have access installed but, I think you can just use the left function... SELECT left(fieldName, 20) as newFieldName
Post Follow-up to this messageThank you. That works for one field. What if I wanted to get the first 20 characters from multiple fields? I'm trying to display the first few lines of few articles. Each article has its own field in the db. Any ideas? KenJ wrote: > I don't have access installed but, I think you can just use the left > function... > > SELECT left(fieldName, 20) as newFieldName >
Post Follow-up to this messageOn Wed, 25 Jan 2006 20:39:45 -0500, T.M. wrote: >What is the correct syntax for querying the first 20 characters of a >memo field? > >I'm trying to >SELECT CAST (varchar(20) fieldname) as newfieldname >and i get a bunch of errors > >Can someone please help me? > >MS Access DB used with ColdFusion > >Thanks Hi T.M., For Access help, you might want to post to an Access group. This group is for SQL Server. :-) In SQL Server, you'd use SELECT CAST(fieldname AS varchar(20)) AS newfieldname FROM tablename I have no idea how well that would port to Access. -- Hugo Kornelis, SQL Server MVP
Post Follow-up to this messageT.M. (iamcarterwells@yaho o.com) writes: > Thank you. > That works for one field. What if I wanted to get the first 20 > characters from multiple fields? I'm trying to display the first few > lines of few articles. Each article has its own field in the db. Any > ideas? comp.databases.ms-access -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pr...oads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodin...ions/books.mspx
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread