Happy Monday! I am new to SQL coding and I want to look for a condition where the oldest date value is determined and then assigned to a new variable. Example:
Which of these four is the oldest (by date) and return it as a new variable @Oldest. These four variables will never have the same value.
@var1 = 01-20-14 12:51:00.000
@var2 = 01-20-14 12:52:00.000
@var3 = 01-20-14 12:53:00.000
@var4 = 01-20-14 12:54:00.000
@Oldest = ????
How would I structure this in SQL?