SQL Question

Discussion in 'ASP General' started by Jim Holmes, Mar 23, 2005.

  1. Jim Holmes

    Jim Holmes Guest

    I have an Access table with a column of ascending values. I am trying to
    find the value in that column that is less than a calculated variable (kind
    of like the vlookup function in Excel). Haven't had any success in writing
    an sql statement or finding an example. Could someone point me in the right
    direction? Thanks Jim
    Jim Holmes, Mar 23, 2005
    #1
    1. Advertising

  2. Jim Holmes

    Jim Holmes Guest

    Unfortunately, the code below only selects the first item in my table
    instead of the 63rd (which is the first value less than 57.13).
    value=57.13
    mySql="SELECT * FROM monthly WHERE a_n < '"&value&"'"
    Jim

    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:...
    > sql = "select * from tableName where field < " & yourValue
    >
    >
    > --
    > Curt Christianson
    > Site & Scripts: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "Jim Holmes" <> wrote in message
    > news:...
    > >I have an Access table with a column of ascending values. I am trying to
    > > find the value in that column that is less than a calculated variable
    > > (kind
    > > of like the vlookup function in Excel). Haven't had any success in
    > > writing
    > > an sql statement or finding an example. Could someone point me in the
    > > right
    > > direction? Thanks Jim
    > >
    > >

    >
    >
    Jim Holmes, Mar 23, 2005
    #2
    1. Advertising

  3. Jim Holmes

    PiGei Guest

    I think yo have to eliminate the '

    PGei

    "Jim Holmes" <> wrote in message
    news:...
    > Unfortunately, the code below only selects the first item in my table
    > instead of the 63rd (which is the first value less than 57.13).
    > value=57.13
    > mySql="SELECT * FROM monthly WHERE a_n < '"&value&"'"
    > Jim
    >
    > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > news:...
    >> sql = "select * from tableName where field < " & yourValue
    >>
    >>
    >> --
    >> Curt Christianson
    >> Site & Scripts: http://www.Darkfalz.com
    >> Blog: http://blog.Darkfalz.com
    >>
    >>
    >> "Jim Holmes" <> wrote in message
    >> news:...
    >> >I have an Access table with a column of ascending values. I am trying
    >> >to
    >> > find the value in that column that is less than a calculated variable
    >> > (kind
    >> > of like the vlookup function in Excel). Haven't had any success in
    >> > writing
    >> > an sql statement or finding an example. Could someone point me in the
    >> > right
    >> > direction? Thanks Jim
    >> >
    >> >

    >>
    >>

    >
    >
    PiGei, Mar 23, 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. dna
    Replies:
    1
    Views:
    1,270
  2. William \(Bill\) Vaughn
    Replies:
    0
    Views:
    442
    William \(Bill\) Vaughn
    Aug 21, 2003
  3. David Browne
    Replies:
    0
    Views:
    455
    David Browne
    Aug 21, 2003
  4. ecoolone
    Replies:
    0
    Views:
    753
    ecoolone
    Jan 3, 2008
  5. Jules
    Replies:
    6
    Views:
    150
    Jules
    Jul 15, 2003
Loading...

Share This Page