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. Advertisements

  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. Advertisements

  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. Advertisements

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,443
  2. Paul M

    SQL database table ot SQL schema

    Paul M, Dec 8, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    516
    Mythran
    Dec 8, 2003
  3. Biggie
    Replies:
    1
    Views:
    3,751
    Alvin Bruney [MVP]
    Feb 6, 2004
  4. =?Utf-8?B?UmV6YQ==?=
    Replies:
    3
    Views:
    18,400
    Carlos Barini
    Jun 7, 2004
  5. =?Utf-8?B?UmV6YQ==?=
    Replies:
    2
    Views:
    1,951
    bruce barker
    Jun 8, 2004
  6. =?Utf-8?B?YW5kcmV3MDA3?=

    question row filter (more of sql query question)

    =?Utf-8?B?YW5kcmV3MDA3?=, Oct 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,159
    Scott Allen
    Oct 6, 2005
  7. ecoolone
    Replies:
    0
    Views:
    923
    ecoolone
    Jan 3, 2008
  8. Jules
    Replies:
    6
    Views:
    385
    Jules
    Jul 15, 2003
Loading...