January 9, 2025 at 2:54 pm
Good Afternoon.
I have a Table where each Record:
1) Represents an Appointment.
2) Has a field Appointment Date.
What I am trying to achieve is this: For each Appointment date in the dataset I wish to count up all the Appointments which occur within 30 days. For example, for 1st July 2024, I wish to have a total count of all appointments which occurred between 1st July 2024 and 30th July 2024 (and assign this count to 1st July 2024).
And then continue this process for each Appointment Date within the Dataset.
Kind Regards
January 9, 2025 at 4:03 pm
Please don't cross post. It tends to fragment the discussion.
Please respond to this post https://www.sqlservercentral.com/forums/topic/count-of-total-appointments-within-30-days-of-each-appointment-date
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
January 9, 2025 at 5:18 pm
Example list of appointment dates from the Appointments Table (many records will have identical Appointment Date) as multiple clients will have appointments on the same day to each other:
Expected Output for 1st and 2nd July 2024 (assuming we are interested in appointments within 3 days - rather than 30 days as the case in my real-life problem I am working on):
January 9, 2025 at 5:30 pm
Just to be sure... you're in an SQL Server 7/2000 forum... which release of SQL Server are you actually using?
And, yeah... It's really important because there's a whole lot missing in 7/2000 compared to recent releases.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply