I am analyzing some data that has two DateTime columns indicating the date of starting production of different products for a facility. So the data looks like this:
<code>FacilityID, DateStart Product1, DateStart Product2
111, 2022-02-01, 2022-01-15
200, 2019-01-01, 2019-03-01
</code>
<code>FacilityID, DateStart Product1, DateStart Product2
111, 2022-02-01, 2022-01-15
200, 2019-01-01, 2019-03-01
</code>
FacilityID, DateStart Product1, DateStart Product2
111, 2022-02-01, 2022-01-15
200, 2019-01-01, 2019-03-01
My result needs to be the earliest of the two dates. The result would show this:
<code>FacilityID, Start Date
111, 2022-01-15
200, 2019-01-01
</code>
<code>FacilityID, Start Date
111, 2022-01-15
200, 2019-01-01
</code>
FacilityID, Start Date
111, 2022-01-15
200, 2019-01-01
I may be wrong; but I have not found an out-of-the-box function that can check two dates and give me the earliest (or latest) of the two dates.
Any ideas how to do this?