Page 1 of 1

Search for blockouts

Posted: Mon Mar 07, 2022 12:55 pm
by chanpong
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

Re: Search for blockouts

Posted: Mon Mar 07, 2022 1:25 pm
by Tom Zaccaria
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

Re: Search for blockouts

Posted: Mon Mar 07, 2022 1:58 pm
by chanpong
Thanks...I was thinking about searching for certain text within a blockout. Is that possible to add to your query?

Brian

Re: Search for blockouts

Posted: Tue Mar 08, 2022 3:03 am
by Tom Zaccaria
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

Re: Search for blockouts

Posted: Tue Mar 08, 2022 11:09 am
by chanpong
Thanks, that worked well!

Brian