Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find records with the latest date
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Find records with the latest date
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01155326
Message ID:
01155326
Views:
64
Hi everybody,

I have the following select
select LT.cTrans_pk, LT.cPatients_fk,  ;
			LT.iBatch_Number, LST.cStage_Trans_pk ;
			from load_trans LT inner join load_stage_trans LST ;
			on LT.cClient_Account_Number = LST.cClient_Account_Number and ;
			LT.cClient_Code = LST.cClient_Code ;
			where LT.cClient_Code = "1201" and LST.tEntered_Date > date() - 7 ;
			into cursor cursor_trans_stage nofilter ;
			order by LT.iBatch_Number
Now I want the same select, but I want to use only records with maximum date from Load_Stage_Trans. In other words, I may have several records in LST, but I want just one of them with the latest date. How can I change my select statement?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform