Question : How do I write this SQL Syntax

I have following table data

LocationID, JobID, ScanDate

I would like to get the latest locationID distict by JobID
table data will be like this

LocationID  |   JobID   |  ScanDate
1                 |     1       |   1/2/2010  --older
1                 |     2       |    1/3/2010
2                |      1       |   1/4/2010   --newer
2                |       3      |   1/5/2010  * older
2                |       4      |   1/2/2010
3                |       3      |   1/6/2010   *newer

*these rows are newer than other jobID, so I would like to return only these.

 I would like to get Query results as follow

LocationID  |  JobID  |  ScanDate
1                 |     2     |    1/3/2010
2                 |     1     |    1/4/2010
2                 |     4     |     1/2/2010
3                 |     3     |     1/6/2010


basically, I would like to track which location has Latest jobID

I'm using SQL server 2008
Thank you for your help







Answer : How do I write this SQL Syntax

Perhaps this
1:
2:
3:
4:
5:
6:
For i = (Me.LstRHFGrants.ListCount + 1) To ((Me.LstRHFGrants.ListCount + 1) + 4)
    year = year + 1
    With Me.LstRHFGrants
      .AddItem (grantdesc & ";" & year)
    End With
Next
Random Solutions  
 
programming4us programming4us