Page tree
Skip to end of metadata
Go to start of metadata
declare @@today datetime = cast(getdate() as Date)
declare @@dateto datetime = dateadd(d, @0 - 1, @@today) -- вместо @0 количество дней для вывода на портал. Настройка Schedule.Days
select distinct 
lpu.guidlpu from oms_lpu lpu with(nolock)
join oms_department dep with(nolock) on dep.rf_lpuid = lpu.lpuid
join hlt_docPRVD prvd with(nolock) on prvd.rf_departmentid = dep.departmentid
join hlt_DoctorTimeTable dtt with(nolock) on dtt.rf_docprvdid = prvd.docprvdid
join hlt_DocBusyType dbt with(nolock) on dtt.rf_docbusytype = dbt.DocBusyTypeId
where > @@today
and < @@dateto
and dbt.TypeBusy = 1
and prvd.InTime = 1
  • No labels