General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only