Search for blockouts

For users or potential users.
Post Reply
chanpong
Posts: 3
Joined: Mon Mar 07, 2022 12:41 pm

Search for blockouts

Post by chanpong » Mon Mar 07, 2022 12:55 pm

Is there any way to search for blockouts? We use it to indicate which doctor is working in our office that day and it would be helpful to be able to search all the blockouts for the year.

Thanks,

Brian

Tom Zaccaria
Posts: 353
Joined: Mon Feb 25, 2008 3:09 am

Re: Search for blockouts

Post by Tom Zaccaria » Mon Mar 07, 2022 1:25 pm

Would this help

/*1385 Blockout list in a date range, defaults to current date up to date specified.*/
SET @FromDate='2020-11-1', @ToDate=curdate(); /*Change here to look for blockouts past this date*/
/*---------------------DO NOT MODIFY BELOW THIS LINE---------------------*/
/*Query code written/modified: 12/21/2017, 05/31/2019 MattG*/
SELECT
SchedDate, StartTime, StopTime,
(SELECT ItemName FROM definition WHERE DefNum = BlockoutType) AS BlockoutType,
Note
FROM SCHEDULE
WHERE SchedType = 2 -- Blockout
AND SchedDate BETWEEN @FromDate AND @ToDate
ORDER BY SchedDate

drtmz

chanpong
Posts: 3
Joined: Mon Mar 07, 2022 12:41 pm

Re: Search for blockouts

Post by chanpong » Mon Mar 07, 2022 1:58 pm

Thanks...I was thinking about searching for certain text within a blockout. Is that possible to add to your query?

Brian

Tom Zaccaria
Posts: 353
Joined: Mon Feb 25, 2008 3:09 am

Re: Search for blockouts

Post by Tom Zaccaria » Tue Mar 08, 2022 3:03 am

Not sure but this one will,

select SchedDate, SchedType, Note from schedule
where schedtype = 2
AND Note <> " "
AND SchedDate > '2020,1,1'

********
AND Note <> " " ... will bring up all the blockouts that have text in them

use this line
AND Note like '%DrZ%'...to bring up and notes with a specific text in them, you must be specific here Dr.Z, DrZ and Dr. Z are all different.

I can fix the dates if you need a range.

drtmz

chanpong
Posts: 3
Joined: Mon Mar 07, 2022 12:41 pm

Re: Search for blockouts

Post by chanpong » Tue Mar 08, 2022 11:09 am

Thanks, that worked well!

Brian

Post Reply