2
Answers

Releted to .NET and future

Photo of Heki Ron

Heki Ron

9y
298
1
Hello Sir,
 
 i am 2014 pass out student, i created project on .net and now i am working in small company, here also i code for .net.
 I thought company provided training but they didn't so i learn myself 
when i saw that many of my friends who working on CMS like wordpress and all earn a lot and done task very easily compare to me, i knew comparison is not good but still :(
 
Even i heard that only MVC architecture is valuable in .net.
 
[Anyone please show me the right path and suggest me also right way to learn .net specially C#.net and also if you help me that how i  think better then its great for me.
 
Thanks

Answers (2)

0
Photo of Kunal Vaishya
NA 4.1k 266.1k 13y
Dear Haider ali


    We make Query for you try this



-------------------------------------------------------------------------------
first create a function for date range in Sql Query
-------------------------------------------------------------------------------
create Function GetDateRange (@month int,@Year int)
RETURNS @OutTable Table   

    dt datetime 

As
Begin
    declare @FRDate datetime
    declare @ToDate datetime

    SET @FRDate = convert(varchar(10), convert(varchar(4), @Year) + '/' + convert(varchar(2),@month) + '/01' ,112)
    set @ToDate= dateadd(MM,1,@FRDate)
    set @ToDate= dateadd(DD,-Day(@FRDate),@ToDate)

    Begin


    with im as
    (select @FRDate as [nom]
        union all
     select [nom] + 1 from Im where [nom] < @ToDate)

    insert into @OutTable
    select *  from im

    ENd
return
End
-----------------------------------------------------------------------------------------------------------------------
After Create Query Like This
-----------------------------------------------------------------------------------------------------------------------
declare @month int
set @month=4
Declare @Year int
set @Year = 2012

select e.EmpName, Qry.AbsentDate from
(select e.empid ,DTRAnge.dt as AbsentDate
from employee e
cross apply (select * from dbo.GetDateRange(@month,@Year)) as DTRange ) as Qry
inner join employee e on e.empid=Qry.EmpId
left outer join   attandance A on A.empid = Qry.EMpID And  A.dateofprentday = Qry.AbsentDate
where  isnull(A.EmpId,0) = 0