Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying on most current
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01309704
Message ID:
01309707
Vues:
8
This message has been marked as the solution to the initial question of the thread.
>I am setting up this query here.
>
>
SELECT DISTINCT Sitedata.id, Sitedata.site_name, Sitedata.resp_party, Sitedata.r1,;
>  Sitedata.street, Sitedata.city, Sitedata.status, Sitedata.material,;
>  Sitedata.date_rep, reports.recvdate, reports.respdate, reports.rptname;
> FROM ;
>     events!Sitedata;
> LEFT OUTER JOIN events!reports ;
>   ON  sitedata.id = reports.id;
> WHERE ISBLANK(reports.respdate) = .T.;
> 		AND (Sitedata.status = "O" OR Sitedata.status = "M");
> 		AND DATE() > reports.recvdate + 30 ;
> 		AND reports.recvdate = (select max (recvDate) from Reports where SiteData.ID = Reports.ID) ;
> ORDER BY Sitedata.id;
> INTO CURSOR reviewer
>WITH thisform
>.WindowState = 2
>ENDWITH	
>BROWSE
>thisform.Visible = .F.
>WITH thisform
>.WindowState = 0
>ENDWITH	
>DO FORM frmexport.scx TO m.exportcheck
>IF m.exportcheck = "a"
>	EXPORT TO C:\Temp\NoReviewer.xls TYPE xls 	
>ENDIF
>thisform.Visible = .T.
>
>I need to display only the report entry that has the most recent rcvdate as a lot of them have many reports. What would be a way to do this in a query. I can think of other ways, such as creating a flag in the reports table, but I am hoping not to take that route. This seems like it should be simple, but it isn't coming to me.

Try with the modification I put. BTW, it's not a good idea to use ISBLANK function in SELECT. If you need to check for empty date just use date = {} as a condition.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform