Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to simplify sql commands
Message
From
26/01/2000 15:14:24
 
 
To
25/01/2000 10:46:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00320611
Message ID:
00323093
Views:
33
I actually thought about a solution similar to but I was hoping for something simpler. Thanks for the code. I may end up using it. :)

>I shortened the names to 10 chars, but this approach seems to work:
>
>SELECT CTalentId + DTOC( Dappoint) AS Key_, cStatus ;
> FROM TalentAppointments ;
> WHERE cStatus = "SUBMITTED" AND ;
> CTalentId + DTOC( Dappoint) IN ;
> ( SELECT MAX( CTalentId + DTOC( Dappoint) ) ;
> FROM TalentAppointments ;
> GROUP BY CTalentId ;
> )
>
>There may be issues if you can have multiple records for same talent on same day.
>
>I realize now the approach we both tried would not work because when using the statistical SQL functions, you never get an aligned independent field, rather only the GROUP BY field and the calculated statistic. If it had been a SUM() we would have realized that. Something abotu MIN and MAX makes you think you would get the real record. But that could not ever be--think about the situation where 2 or more records has the same max or min value.
>
>-- Randy
Previous
Reply
Map
View

Click here to load this message in the networking platform