select HN
from(
SELECT convert(varchar(10), [IREQ_OD_DT], 120) as OrderDate
,[IREQ_PID] as HN
FROM [view_lab_information_Request]
where IREQ_INACTIVE = 'N' and IREQ_OD_DT between '@d1' and '@d2'
) as x
group by OrderDate, HN
---start @d1 End @d2
---search date text= Order Date
----------Pivot
--------------------
--------------------
select HN
from(
SELECT convert(varchar(10), [IREQ_OD_DT], 120) as OrderDate
,[IREQ_PID] as HN
FROM [view_lab_information_Request]
where IREQ_INACTIVE = 'N' and IREQ_OD_DT between '@d1' and '@d2'
) as x
group by OrderDate, HN
---------------
---------------
To embed this project on your website, copy the following code and paste it into your website's HTML: