Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Always trips me up!
Message
From
14/06/2007 14:22:39
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01233129
Message ID:
01233192
Views:
18
>Try
>
>SELECT * FROM Members mb
>  JOIN StatusHistory sh ON sh.MemberId = mb.MemberId
>  WHERE sh.ChangeDate = (SELECT MAX(ChangeDate) FROM StatusHistory WHERE MemberId = sh.MemberId)

Yes! Seems simple when you do it. :)

>
>
>
>>
>>This kind of query should be common yet I often seem to break it.
>>
>>Two tables
>>
>>Members, StatusHistory.
>>
>>Status history has the member id the status and the date of the change.
>>
>>I want to grab member info and the current status and change date as of this moment for each member.
>>
>>Please help.
>>
>>Thanks!
Previous
Reply
Map
View

Click here to load this message in the networking platform