HolidayDate is date which is in Table
newholiday is Table Name
Actual_Leave_To is Column Name
I Have a Code Given Below-
declare @Actual_Leave_To date= '2016-08-13'
--set @Actual_Leave_To='2016-08-13'
while (select count(1) from newholiday where Holidaydate = @Actual_Leave_To)>0
begin
set @Actual_Leave_To = DATEADD(d,1,@Actual_Leave_To)
end
select @Actual_Leave_To
My Question is all Public holiday date in my table newholiday so when is query running then increase 1 day in Actual_Leave_To and this cod is
working my problem is i declare 2016-08-13' this day and it add 1 day after running query but i want to know how it will understand when i declare
2016-08-12' next day is 2016-08-13 table and date add 2016-08-14
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Manas MohapatraRank #182 · 13.2K reputationPosted Jan 6, 2016, 12:35 AM EST
MukeshRank #7,688 · 236 reputationPosted Jan 6, 2016, 12:39 AM EST