#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    81
    Rep Power
    11

    finding the record that has the least time difference


    I am new to MySql.
    I have a time string( with data and time).
    I have the database with name and several times for each name record.
    I want to find for a particular name, the record that has the least time difference with the time string I have.
    Can someone help me to write a query for this?
    Thanks,
    Lalitha
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,030
    Rep Power
    4210
    answer is in the mysql forum

    http://forums.devshed.com/t118355/s.html
    r937.com | rudy.ca
    please visit Simply SQL and buy my book

IMN logo majestic logo threadwatch logo seochat tools logo