Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    5

    Unanswered: choosing latest in a given point

    let me tell me my problem clearly:
    i have some dates sorted by ascending...
    i want to enter a parameter date and list the latest time smaller or equal than this parameter.
    when i choose last or maximum only, it showes the latest result. however, when i add the <[date] parameter, it doesnt show me the results. it still tries to show the latest results by ignoring the date i entered. if i enter a date which is smaller then the latest or maximum time, it doesnt show anything. how i can choose the latest time in a given date?
    here is the problematic sql, how can this be corrected?
    SELECT Users.UserName, Users.UserSurname, Max([events].Time) AS [Time]
    FROM [events] INNER JOIN users ON [events].UserID = Users.UserID
    GROUP BY Users.UserID, Users.UserName, Users.UserSurname
    HAVING (((Max([events].Time))<[enter date]))
    ORDER BY Users.UserID;

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    try this --
    Code:
    select users.userid
         , users.username
         , users.usersurname
         , max([events].time) as [time] 
      from [events]
    inner
      join users 
        on [events].userid = users.userid 
     where [events].time < [enter date]    
    group 
        by users.userid
         , users.username
         , users.usersurname
    order
        by users.userid
    rudy
    http://r937.com/

  3. #3
    Join Date
    Dec 2003
    Posts
    5
    no, it didnt work
    and i dont know why
    can you check your pm?
    any suggestions?..

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    try < "#" + [enterdate] + "#"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •