Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Adding text to Rank Expand / Collapse
Author
Message
Posted Wednesday, May 15, 2013 9:33 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 6:48 AM
Points: 125, Visits: 361
Ok Mark, Thanks, that works very fine.

Thanks, i'm very grateful

Tim
Post #1453184
Posted Wednesday, May 15, 2013 9:34 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 6:48 AM
Points: 125, Visits: 361
Hi Lynn,
Thanks for your reply, but i think Mark has solved the problem, just follow his post

Thanks

Tim
Post #1453186
Posted Wednesday, May 15, 2013 9:36 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 6:47 PM
Points: 23,396, Visits: 32,229
timotech (5/15/2013)
Hi Lynn,
Thanks for your reply, but i think Mark has solved the problem, just follow his post

Thanks

Tim


Oh, I saw it and had come to the same conclusion.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1453187
Posted Wednesday, May 15, 2013 9:45 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 6:48 AM
Points: 125, Visits: 361
Sorry Lynn,
I meant to say that your corrections are noted, and i will make sure, i do it the right way next time.

Thanks

Tim
Post #1453191
Posted Thursday, May 16, 2013 8:42 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 11:50 AM
Points: 431, Visits: 1,742
Mark-101232 (5/15/2013)
SELECT AdDate, AdTime, FK_StationId, CAST(rank() over(partition by fk_stationid order by addate,adtime) AS VARCHAR(10)) + ' of ' +
CAST(count(*) over(partition by fk_stationid) AS VARCHAR(10)) as Position
FROM dbo.TestTable
GROUP BY AdDate, AdTime, FK_StationId
HAVING (AdDate = CONVERT(DATETIME, '2013-04-01 00:00:00', 102))



This is the coolest thing I've seen SQL do in weeks. Thanks.
Post #1453588
Posted Thursday, May 16, 2013 11:02 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 6:48 AM
Points: 125, Visits: 361
Hi Erik, why do you say it's the coolest thing?
Post #1453685
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse