|
Posted by Simon Hayes on 10/18/24 11:26
<alanchinese@yahoo.com> wrote in message
news:1126515686.610625.110860@z14g2000cwz.googlegroups.com...
>i should say "of course i would be easier to have a EndingDate"
> column...
> indeed, i didn't add that column, because it's hard to maintain the
> data (have to check the consistency, and update more than one row of
> data...)
>
This is probably what you want:
select DataName, max(StartingDate)
from dbo.MyTable
where StartingDate <= '20040101'
group by DataName
order by DataName
If that doesn't help, please post your sample data in the form of CREATE
TABLE and INSERT statements, so that others can quickly copy and paste into
Query Analyzer to try it.
Simon
Navigation:
[Reply to this message]
|