Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Making a Recordset Field Cut short with dot dot dot! Help !

1 view
Skip to first unread message

Matt Lane

unread,
Oct 29, 2001, 7:02:02 AM10/29/01
to
How do I make a recordset field which may be cut short like on a search
engine so it only displays a certain ammount of characters and then ends
...?

Julian Roberts

unread,
Oct 29, 2001, 7:12:34 AM10/29/01
to
Try:

select left(field,200) + '...' as ShortField from table

--

Jules
Team Macromedia
http://charon.co.uk
ICQ 51328805

CharonCart II (£free)
Ultradev 4 shopping cart extension
http://charon.co.uk/charoncart


"Matt Lane" <ml...@thefoundationdesign.com> wrote in message
news:B802F5BA.25E0%ml...@thefoundationdesign.com...

Waldo Smeets - UDzone.com

unread,
Oct 29, 2001, 7:46:48 AM10/29/01
to
> select left(field,200) + '...' as ShortField from table

Or use the trim text extension: www.UDzone.com/go?68. However be aware that
the method provided by Jules seems to perform better in some situations (or
am I wrong Jules?).

--
Waldo Smeets - www.UDzone.com Webmaster
------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
------------------------------------------


Waldo Smeets - UDzone.com

unread,
Oct 29, 2001, 7:47:41 AM10/29/01
to
I forgot to add that the extension has a nice advanatge above the SELECT
code: the extension allows you to trim the text in a proper way so the words
are not cut-off.

Julian Roberts

unread,
Oct 29, 2001, 8:21:29 AM10/29/01
to
Yes, it would be marginally better to do the trimming at database level than
at page level. In SQL server you could probably trim to the nearest word
too.

--

Jules
Team Macromedia
http://charon.co.uk
ICQ 51328805

CharonCart II (£free)
Ultradev 4 shopping cart extension
http://charon.co.uk/charoncart


"Waldo Smeets - UDzone.com" <em...@waldosmeets.com> wrote in message
news:9rjikt$r6t$1...@forums.macromedia.com...

0 new messages