A web application for managing a day laborer referral organization. Built using .NET Core MVC, Entity Framework Core, jQuery, Datatables (datatables.net).
DECLARE @beginDate datetime = '2020-01-01';
DECLARE @endDate datetime = GETDATE();
with
signins (dwccardnum, signincount)
as
(
select wsi.dwccardnum, count(*) as [signincount]
from WorkerSignins wsi
Where wsi.dateforsignin >= @begindate
and wsi.dateforsignin < @enddate
group by wsi.dwccardnum
)
select
si.dwccardnum as [cardnum],
si.signincount as [sign ins],
FORMAT( w.dateOfBirth, 'd', 'en-US' ), -- unnamed column
DATEDIFF(year, w.dateOfBirth, GETDATE()) as [age],
p.fullName,
p.nickname,
p.phone,
p.cellphone,
p.email,
p.facebook
from
Workers w
join Persons p on p.ID = w.ID
join signins si on si.dwccardnum = w.dwccardnum
WHERE w.dateOfBirth <= DATEADD(month, -589, GETDATE())
ORDER BY DATEDIFF(year, w.dateOfBirth, GETDATE())
WHAT
queries without a column name won't run:
WHERE
Report editor