Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Counting distinct periods of consecutive days

By Harsha Majety,

My friend gave me an interesting problem yesterday. He works for a hospital and needs to count patient visits, and if a patient visits the doctor on consecutive days, it needs to be counted as 1 visit. Here is how i solved it. This is just one of many ways to do it.

Total article views: 1915 | Views in the last 30 days: 1
 
Related Articles
BLOG

Visiting Atlantis

This week I got to visit Atlantis. Not the mythical island, but rather the ship, the Space Shuttle A...

BLOG

Blog Changes on SQLServerCentral.com & Visiting The IndyTechFest

Perhaps you've noticed a few of the blog changes if you visit via the web rather than RSS. One good....

BLOG

Visiting West Palm Beach SQL Group on April 29, 2009

I'm going to West Palm Beach on Apr 29th to visit Scott Klein and his group. I'll be doing a...

FORUM

how to calculate duration spent on every visit

I have to show sessionID PageId Duration spent for a page visit

BLOG

Visiting the Charlotte SQL User Group on Feb 27th

I'll be visiting the Charlotte SQL Group on Feb 27th and I'll be doing one of my favorite presentati...

 
Contribute