• First of all, it will be more helpful if you would supply your sample data in a runable/executable way, something like this:

    Select '2013-04-01' AdDate,'07:52:00' AdTime ,'A1' Fk_StationId

    into #TestTable

    Union All Select '2013-04-01','07:52:43','A1'

    Union All Select '2013-04-01','08:05:06','A1'

    Union All Select '2013-04-01','08:20:45','A1'

    Union All Select '2013-04-01','06:00:00','A10'

    Union All Select '2013-04-01','06:03:12','A10'

    Union All Select '2013-04-01','06:19:01','A10'

    Union All Select '2013-04-01','06:32:31','A10'

    Union All Select '2013-04-01','06:43:36','A10'

    Here is one of the way how you can add the count you want:

    SELECT AdDate, AdTime, FK_StationId

    , CAST( rank() over(partition by fk_stationid order by addate,adtime) AS VARCHAR) +

    ' of ' + cc.cnt as Position

    FROM #TestTable t1

    CROSS APPLY (SELECT CAST(COUNT(*) AS VARCHAR) cnt FROM #TestTable t2 WHERE t2.Fk_StationId = T1.Fk_StationId) cc

    GROUP BY AdDate, AdTime, FK_StationId, cc.cnt

    HAVING (AdDate = CONVERT(DATETIME, '2013-04-01 00:00:00', 102))

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]