Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9F25Er68700 for ; Sun, 14 Oct 2001 22:05:14 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f9F1u2q53171 for pgsql-sql@postgresql.org; Sun, 14 Oct 2001 21:56:02 -0400 (EDT) (envelope-from news) From: "guard" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: to_char()?? Date: Mon, 15 Oct 2001 09:56:26 +0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 23 Message-ID: <9qdfnh$1jte$1@news.tht.net> References: <9qb2lj$13lv$1@news.tht.net> <9qd0j0$1gc3$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-sql@postgresql.org X-Archive-Number: 200110/184 X-Sequence-Number: 5139 thanks I have run "select substr('hi there', 3, 5)::varchar(5) as xx;" but get error message Error: ERROR: parser: parse error at or near ":" -- "Lee Harr" ¼¶¼g©ó¶l¥ó·s»D :9qd0j0$1gc3$1@news.tht.net... > > > > how to > > select substr('hi there',3,5) as xx -->> xx change char type > > > > How about: > > select substr('hi there', 3, 5)::varchar(5) as xx; > > or is this not what you mean? >