You are here: Re: sql query question.... « MsSQL Server « IT news, forums, messages
Re: sql query question....

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация