Hi Sebastian,
My subquery includes 'GROUP BY EmpID' that generates one record per EmpId.
Select Str(EmpID) + Dtos(max(EffectiveDate)) ;
from t1 ;
where EffectiveDate <= ?dParam ;
group by EmpID
>Hi, Sergey!
>
>>>
>I tested it before posting and once again this morning and it returned correct result. I think you should check your data and dParam value.
><<
>
>Ok - I believe it <s>! May be there is some problem in my testdata - but I'm confused about the following: In all my tested circumstances the subselect
>
>Select Str(EmpID) + Dtos(max(EffectiveDate)
>
>returns only one record (IMO caused by the MAX() function).
>
>Can you explain to me why this can work correctly (independent from possible errors during my tests <s>) - to make the whole SQL to give 3 records back IMO it's neccesary to get 3 records from the subselect.
>
>TIA!
--sb--