ContractStartDate & ContractEndDate returning dummy dates (1900-01-01 & 4000-01-01) - how can I remove them?
0
votes
0
answers
37
views
ContractStartDate & ContractEndDate returning dummy dates (1900-01-01 & 4000-01-01) - how can I remove them? I'll be using DirectQuery in Power BI to build a report but been asked to remove the "Dummy Dates". Any suggestions would be appreciated.
Select * from(
SELECT [ContactID]
,a.[InjixoID]
,a.[start_date] as ContractStartDate
,a.[end_date] as ContractEndDate
,b.EmployeeID
,b.[Full name]
,c.LeaveDate as CiphrLeaveDate
,d.ContractName
,d.ContractHours
,d.NoOfDays
,(ROW_NUMBER() over (partition by a.InjixoID Order by a.[start_date] desc)) as rn
FROM [Staging].[InjixoContactsbyPU] a
left join InjixoUsers b on a.InjixoID = b.InjixoID
left join Employees c on b.EmployeeID = c.EmployeeId
left join InjixoContracts d on a.ContactID = d.contract_id
left join InjixoEmployeePeriods e on b.InjixoID = e.employee_id
where a.end_date >= getdate()
--order by b.EmployeeID
) t1
where t1.rn = 1
Asked by Kris Martin
(1 rep)
Oct 25, 2022, 09:04 AM
Last activity: Oct 25, 2022, 09:59 AM
Last activity: Oct 25, 2022, 09:59 AM