getting records with highest date 
Author Message
 getting records with highest date

Thanks Phil that really did it, but now it will not allow me to add
new records, it allow me to edit the recordset but it will not allow
me to add new records, it tells me "error field is not updateble",
here is the RS:

Data1.RecordSource = "SELECT tblMarines.MarineID,
Marine_PFT.PfT_Score,Marine_PFT.Qual_date as [PFT Date:] ,
tblMarines.Lastname as [Last Name:], tblMarines.fname as [First
Name:]," & _
   " Marine_PFT.Pull_ups as [Pullups:]," & _
   " Marine_PFT.run_time as [Run Time:]," & _
   "Marine_PFT.Crunches, Marine_PFT.Body_Weight as [Body Weight:]," &
_
   "Marine_PFT.Fat_Percent as [Fat %], tblWorkSection.Platoon_ID as
[Platoon ID] " & _
   "From (tblMarines INNER JOIN Marine_PFT ON tblMarines.MarineID =
Marine_PFT.MarineID)" & _
   " INNER JOIN tblWorkSection on tblMarines.platoon_code =
tblWorksection.Platoon_ID" & _
   " WHERE Marine_PFT.qual_date = (Select Max(qual_date) from
Marine_PFT " & _
   " Where Marine_PFT.MarineID = tblMarines.MarineID) and " & _
   " tblWorkSection.Platoon_ID = " & QuickRef.SectionID & "" & _
   " ORDER BY Marine_PFT.Qual_date DESC"

Quote:

> An Example, assume parent and child are the table names,
> child hold multiple records with dates

> SELECT parent.name, child.date
> from parent
> join child
> on parent.id = child.id
> where child.date = ( select max(date) from child c
> where c.id = parent.id)

> Hope this helps

> >-----Original Message-----
> >Hello,

> >I have a one to many relationship employees-----
>  <recertification
> >I would like to get all the records with the highest
>  date, is there a
> >way I can do this ?

> >Thanks in advance,

> >Kaspa
> >.



Wed, 12 May 2004 09:10:34 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. getting records with highest date

2. getting records with highest date

3. Getting the last date of a record

4. Getting records for a particular Date

5. Getting records of a particular date

6. Not getting all expected records due to date-time issue in the Oracle database

7. Getting a Record of oldest date using SQL

8. Getting higher than 9600 baud in QB4.5

9. Getting 6th highest pay scale

10. Getting higher week number

11. High Quality Rolex Day-Date

12. VBA date query - not getting current date

 

 
Powered by phpBB® Forum Software