ChiliDog007
Technical User
i have created a front end in VB6 to an SQL database. i then use that front end to populate a table. the problem is that i can not select only the most current date. i have tried many different approaches but i can't figure out how to do this. i have a training session that i have to give on Oct 21 and i need to know very soon. here is my sql statement. it will select all dates, i need to select only the most current date.
Code:
Report = "SELECT " _
& "[Machine Data].[Machine Number], " _
& " [Machine Data].[Machine Description], " _
& " [Machine Data].Dept, " _
& " [Machine Data].Disposition, " _
& " [Machine Data].SafeRequire, " _
& " SafeGuard.IDate, " _
& " SafeGuard.Passed " _
& "From " _
& "[Machine Data] " _
& "LEFT OUTER JOIN " _
& "SafeGuard " _
& " ON [Machine Data].[Machine Number] = SafeGuard.MachNum " _
& " WHERE [Machine Data].SafeRequire = 1 " _
& " Group By " _
& " [Machine Data].[Machine Number], " _
& " [Machine Data].[Machine Description], " _
& " [Machine Data].Dept, " _
& " [Machine Data].Disposition, " _
& " [Machine Data].SafeRequire, " _
& " SafeGuard.IDate, " _
& " SafeGuard.Passed " _
& " Order By " _
& " [Machine Data].[Machine Number], " _
& " MAX (SafeGuard.IDate) "