select * from #PopupCal_ProfileDB# where ID='#ID#'
select * from #PopupCal_ProfileDB# where ID='#ID#'
select DISTINCT DAYOFMONTH(EvtDate) as EvtDay from #PopupCal_DetailsDB#
where MONTH(EvtDate)=#month# AND YEAR(EvtDate)=#year#
AND ID='#ID#' AND Repeat=1
select DISTINCT DAYOFMONTH(EvtDate) as EvtDay from #PopupCal_DetailsDB#
where ID='#ID#'
AND Repeat=3
AND ( (MONTH(EvtDate)<=#month# AND YEAR(EvtDate)<=#year#)
OR (YEAR(EvtDate)<#year#) )
select DISTINCT DAYNAME(EvtDate) as DayName from #PopupCal_DetailsDB#
where ID='#ID#'
AND Repeat=2
AND ( (MONTH(EvtDate)<=#month# AND YEAR(EvtDate)<=#year#)
OR (YEAR(EvtDate)<#year#) )