read this
Find all SQL Server DateTime Formats[
^]
i got it ur question answer. please look this
Select dates of a day between two dates.[
^] article it will fulfill your requirement.
if it will solve your problem than click accept solution.
look this simple example:-
declare @dt1 datetime set @dt1 ='15/jun/2012'
declare @dt2 datetime set @dt2 ='30/jun/2012'
declare @cnt int
declare @DayName varchar(50)
declare @i int set @i=1
set @cnt=datediff(day,@dt1,@dt2)
print @cnt
while (@i<=@cnt)
begin
set @DayName=''
set @dt2=dateadd(day,@i,@dt1)
set @DayName= datename(dw,@dt2)
print @DayName
set @i=@i+1
end