SQL Subquery and alias for datagrid use

Discussion in 'ASP .Net' started by .Net Sports, Jul 6, 2005.

  1. .Net Sports

    .Net Sports Guest

    I'm going to be using an sql column's content in one datagrid column,
    and use another datagrid column for another portion of that sql column

    select tbldeal.ID, tblDeal.Sale_Type_ID(select tblDeal.Sale_Type_ID < 3
    as News) from tblDeal where thedate = '7/6/2005'

    is giving me an error: Incorrect syntax near the keyword 'select'.
    I need to display all the salestypeIDs that are under 3 in my datagrid
    column named "News".
    ????
    ..netSports
     
    .Net Sports, Jul 6, 2005
    #1
    1. Advertising

  2. .Net Sports

    tomh Guest

    SELECT tbldeal.ID, tblDeal.Seal_Type_ID AS News
    FROM tblDeal
    WHERE thedate = '7/6/2005' AND Sale_Type_ID < 3

    Not sure if I read your post right, is that what you're looking for?

    Tom
     
    tomh, Jul 6, 2005
    #2
    1. Advertising

  3. your sql is incorrect.
    Please change to:
    select tbldeal.ID, tblDeal.Sale_Type_ID as News from tblDeal where thedate =
    '7/6/2005' and tblDeal.Sale_Type_ID < 3

    --
    Help you,Help me.


    ".Net Sports" wrote:

    > I'm going to be using an sql column's content in one datagrid column,
    > and use another datagrid column for another portion of that sql column
    >
    > select tbldeal.ID, tblDeal.Sale_Type_ID(select tblDeal.Sale_Type_ID < 3
    > as News) from tblDeal where thedate = '7/6/2005'
    >
    > is giving me an error: Incorrect syntax near the keyword 'select'.
    > I need to display all the salestypeIDs that are under 3 in my datagrid
    > column named "News".
    > ????
    > ..netSports
    >
    >
     
    =?Utf-8?B?bWFyc2hhbA==?=, Jul 7, 2005
    #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. Rod
    Replies:
    6
    Views:
    8,752
  2. thecolour
    Replies:
    2
    Views:
    2,478
    thecolour
    Jun 26, 2007
  3. Bogdan
    Replies:
    3
    Views:
    409
    George Ter-Saakov
    Apr 16, 2008
  4. grocery_stocker
    Replies:
    9
    Views:
    766
    grocery_stocker
    May 24, 2008
  5. Lim kiang Leng
    Replies:
    3
    Views:
    215
    Ben Morrow
    Jul 18, 2004
Loading...

Share This Page