Advanced Search SQL Query - All Unpublished Reports Scheduled for the Next 30 days
Hi all -
I've been playing around with creating an advanced search query for a weekly report that returns all requirements due in the next 30 days that are not published. I have the following:
Activities.Publish_Date IS NULL AND (Activities.Type_ID = 526 OR Activities.Type_ID = 157 OR Activities.Type_ID = 527 OR Activities.Type_ID = 5154) AND Activities.Schedule_Date - GETDATE() > 30
However, the query is returning all requirement types with due dates well into 2023 - where am I off here? Alas, Advanced Reporting is not available from BB for SKY and they are not longer running the Classic course. Welcome any insights you have.
Comments
-
Hi Ken,
Try:
Activities.Publish_Date IS NULL AND (Activities.Type_ID = 526 OR Activities.Type_ID = 157 OR Activities.Type_ID = 527 OR Activities.Type_ID = 5154) AND ((Activities.Schedule_Date - GETDATE()) <= 30)
Also, you can use a simpler format for your Type_IDs
Activities.Publish_Date IS NULL AND (Activities.Type_ID IN(526,157,527,5154)) AND ((Activities.Schedule_Date - GETDATE()) <= 30)
1 -
Justin thank you so much for the quick reply and for the Type_ID bundling, didn't know that was an option. Unfortunately, BB is returning results dating back to the start of the Foundation in 2002. I thought the 30 would bind the return to 30 days, but it doesn't seem to.
Background here is that the Foundation is 20+ years old, but never really created an online application system so many requirements were scheduled but never published online.
0 -
We can further restrict the records returned by this query by specifying that the reports also need to have been created after a certain date. For example, if in your new work flow you started publishing all these reports after June 30 this year, you could use the following:
Activities.Publish_Date IS NULL AND (Activities.Type_ID IN(526,157,527,5154)) AND ((Activities.Schedule_Date - GETDATE()) <= 30) AND (Activities.Create_Date > '2021-06-30')
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 209 bbcon®
- 1.4K Blackbaud Altru®
- 395 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 359 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 564 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 934 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.4K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 243 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 238 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 28 PowerUp Challenges
- 3 (Open) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 779 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)

