Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - First 50 characters
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

First 50 characters

 Post Reply Post Reply
Author
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Topic: First 50 characters
    Posted: 02 January 2004 at 1:09pm
Hey, how can i make a sql command to get only the first 50 characters of a record? I mean from record 1 the first 50 chars and the rest of the records complete like always.
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 02 January 2004 at 1:15pm
SELECT Left(column, 50) FROM table;
Back to Top
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Posted: 02 January 2004 at 7:12pm

strCommand = "Select Left(Message, 5) from tblNews"

and this in my html:
<%# binder.Eval(Container.Item, "Message") %><%# Databinder.Eval(Container.DataItem, "Message") %>

i get this error:
DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name Message.

When i'm doing the left function away it works...hmm what i'm doing wrong? It's almost 1:30 am here, i can't see the fault

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 03 January 2004 at 5:55am

Try this:

Select Left(Message, 5) As [Message] from tblNews

Back to Top
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Posted: 03 January 2004 at 7:54am
thanks, works great!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.