problem with sql



hi

I have problem with sql. I dont userstand what should I do.
my problem is

I have table UserLocationHistory

I want those user who have latest date.
I am fired sql like

SELECT DISTINCT userid, datetime
FROM UserLocationHistory
ORDER BY userid, datetime DESC
UserID datetime
80 1/5/2005
80 1/4/2005
80 1/2/2005
124 1/3/2005
124 1/2/2005
124 1/1/2005
130 1/3/2005
186 1/1/2005


but I wnat this reasult like

UserID datetime
80 1/5/2005
124 1/3/2005
130 1/3/2005
186 1/1/2005

so please help me out

regards,
bhavik
.



Relevant Pages

  • Re: help with asp/sql convert data to date for comparison
    ... It must be MS SQL Server ... columns and store proper datetime values in a single column. ... Adjust that until you are creating proper datetimes. ... You should see data in the proper format. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
    ... If so, they are right, just display it with less resolution might be your ticket. ... they were thinking of there was mixed resolutions in one DATETIME column. ... One thing to watch is to NOT take my suggestion and print out everything ... determine if a day exists in it, and build the SQL accordingly. ...
    (comp.lang.java.programmer)
  • Re: Parameter??
    ... in common with most available SQL ... given month' Validation Rule or constraint? ... date_col DATETIME NOT NULL, ... The above relies on the Jet implementation to coerce a DATETIME to ...
    (microsoft.public.access.queries)
  • Re: Parameter??
    ... in common with most available SQL ... given month' Validation Rule or constraint? ... date_col DATETIME NOT NULL, ... The above relies on the Jet implementation to coerce a DATETIME to ...
    (microsoft.public.access.queries)
  • Re: Query Question for the Gurus
    ... datetime as an input parameter and returns the YYYYMMDDHHMM as a string ... select dOctets, myfunc, count ... I'm away from SQL or I could write a small test for you.... ... you could also do datefunctions which return a datetime datatype (rounded to ...
    (microsoft.public.sqlserver.programming)