I am Trying to not use two isnulls since it is making my query extremely slow. what better ways are there to write the following?
[Example] =
CAST (isnull(ap.CustomDate2, (isnull(ap.CustomDate10,
(Select top 1 sts.times
From timetable sts
where sts.ShipmentStatusID IN (8000, 8089)
Order By sts.times DESC)))) AS date