Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now
All I'm trying to do is iterate thru two months of data and collecting the number of patient exams that are due by the date in question. The actual date ('09/12/2011') is the only value that is dynamically inputted at run-time.
SELECT CONVERT(varchar(10), DATEADD(D, [Number], '09/12/2011'), 101) As [TheDate], (SELECT COUNT([PatientID]) FROM [Patients] WHERE [NextExam] <= DATEADD(D, [Number], '09/12/2011')) AS [NextCount], (SELECT COUNT([PatientID]) FROM [Patients] WHERE [POEExam] <= DATEADD(D, [Number], '09/12/2011')) AS [POECount] FROM [Numbers] WHERE [Number] < DATEDIFF(D, '09/12/2011', DATEADD(M, 2, '09/12/2011')) ORDER BY [TheDate];
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Job - date manual||1||48|
|How to add a suffix to a value in a column based on the value in another column||4||36|
|Parsing this XML works but the other one doesn't||9||35|
Join the community of 500,000 technology professionals and ask your questions.