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
Search for blockouts
-
- Posts: 361
- Joined: Mon Feb 25, 2008 3:09 am
Re: Search for blockouts
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
/*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
Thanks...I was thinking about searching for certain text within a blockout. Is that possible to add to your query?
Brian
Brian
-
- Posts: 361
- Joined: Mon Feb 25, 2008 3:09 am
Re: Search for blockouts
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
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
Thanks, that worked well!
Brian
Brian