Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Returning sequential records

Author  Topic 

SQLConfusesMe
Starting Member

4 Posts

Posted - 2014-08-06 : 17:22:34
Hi All,

I was wondering if this can be achieved in SQL, I want to return records that are in consecutive order by week number. I'm getting week number using function DATEPART but I don't know how to get the records that are in order. What I'm trying to achieve is, for example, returning records of all customers that have visited the hairdressers for a shampoo 4 weeks in a row.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-08-06 : 18:33:33
Please provide the info like this: http://www.sqlservercentral.com/articles/Best+Practices/61537/

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -