Select Statement

Discussion in 'ASP .Net' started by bbawa1@yahoo.com, Jun 20, 2007.

  1. Guest

    Hi,

    I have the following query. my message field is of datatype text.
    But I want to grag just first 50 characters + ...
    from that "message" field. How can I do that.

    The following is my sql statement

    select tck.ticketid,tckmsg.message
    from tbtickets tck inner join tbticketsmessages tckmsg
    on tck.ticketid = tckmsg.ticketid and tcktstatusId = 1
    , Jun 20, 2007
    #1
    1. Advertising

  2. David Wier Guest

    if you want to do it in SQL, check out 'substring':
    http://doc.ddart.net/mssql/sql70/setu-sus_17.htm

    when presenting the data on the page, are you using a Gridview/DataSource
    control, or creating the code- then databinding, or .....?

    --
    David Wier
    MVP/ASPInsider
    http://aspnet101.com
    http://iWritePro.com



    <> wrote in message
    news:...
    > Hi,
    >
    > I have the following query. my message field is of datatype text.
    > But I want to grag just first 50 characters + ...
    > from that "message" field. How can I do that.
    >
    > The following is my sql statement
    >
    > select tck.ticketid,tckmsg.message
    > from tbtickets tck inner join tbticketsmessages tckmsg
    > on tck.ticketid = tckmsg.ticketid and tcktstatusId = 1
    >
    David Wier, Jun 20, 2007
    #2
    1. Advertising

  3. Guest

    On Jun 20, 1:06 pm, "David Wier" <>
    wrote:
    > if you want to do it in SQL, check out 'substring':http://doc.ddart.net/mssql/sql70/setu-sus_17.htm
    >
    > when presenting the data on the page, are you using a Gridview/DataSource
    > control, or creating the code- then databinding, or .....?
    >
    > --
    > David Wier
    > MVP/ASPInsiderhttp://aspnet101.comhttp://iWritePro.com
    >
    > <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Hi,

    >
    > > I have the following query. my message field is of datatype text.
    > > But I want to grag just first 50 characters + ...
    > > from that "message" field. How can I do that.

    >
    > > The following is my sql statement

    >
    > > select tck.ticketid,tckmsg.message
    > > from tbtickets tck inner join tbticketsmessages tckmsg
    > > on tck.ticketid = tckmsg.ticketid and tcktstatusId = 1- Hide quoted text -

    >
    > - Show quoted text -


    I am using GridView datasource.
    , Jun 20, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    790
  2. Jay McGavren
    Replies:
    11
    Views:
    1,113
    Alan Krueger
    Jan 16, 2006
  3. tedsuzman
    Replies:
    2
    Views:
    7,064
    Michel Claveau, résurectionné d'outre-bombe inform
    Jul 21, 2004
  4. Ted
    Replies:
    1
    Views:
    452
    Duncan Booth
    Jul 22, 2004
  5. palmiere
    Replies:
    1
    Views:
    388
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page