Sql Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joel

    #1

    Sql Question


    I'm scrolling by Order_# where I find and display on screen the < (lesser
    then) value of Order_#. Here's the syntax:

    "Select * From Orarchd Where `Order_#` < " & lngOrderNumber & " Order By
    `Order_#` Desc"

    lngOrderNumber is the current value of Order_#. Here's the problem ...it
    takes forever to find the next record (at least 10 seconds)


  • Chello

    #2
    Re: Sql Question


    "Joel" <joel@ecsnj.com > wrote in message
    news:%79fd.1975 $eU2.1093@trndn y05...[color=blue]
    >
    > I'm scrolling by Order_# where I find and display on screen the < (lesser
    > then) value of Order_#. Here's the syntax:
    >
    > "Select * From Orarchd Where `Order_#` < " & lngOrderNumber & " Order By
    > `Order_#` Desc"
    >
    > lngOrderNumber is the current value of Order_#. Here's the problem ...it
    > takes forever to find the next record (at least 10 seconds)[/color]

    Do you have an index on the column 'Order_#'? That will speed up things.
    Ramsy


    Comment

    • Joel

      #3
      Re: Sql Question

      Yes! As a matter of fact it's the primary index!

      "Chello" <lraymound@chel lo.nl> wrote in message
      news:DFpfd.8539 2$Ye1.69443@ams news05.chello.c om...[color=blue]
      >
      > "Joel" <joel@ecsnj.com > wrote in message
      > news:%79fd.1975 $eU2.1093@trndn y05...[color=green]
      > >
      > > I'm scrolling by Order_# where I find and display on screen the <[/color][/color]
      (lesser[color=blue][color=green]
      > > then) value of Order_#. Here's the syntax:
      > >
      > > "Select * From Orarchd Where `Order_#` < " & lngOrderNumber & " Order[/color][/color]
      By[color=blue][color=green]
      > > `Order_#` Desc"
      > >
      > > lngOrderNumber is the current value of Order_#. Here's the problem ...it
      > > takes forever to find the next record (at least 10 seconds)[/color]
      >
      > Do you have an index on the column 'Order_#'? That will speed up things.
      > Ramsy
      >
      >[/color]


      Comment

      Working...