SQL 2005 Server.
how can I get most current date in a group of date fields?
e.x i have field1,field2,field3,field4 which is a date field how can i get the most current of the field?
any suggestion? TIA
Printable View
SQL 2005 Server.
how can I get most current date in a group of date fields?
e.x i have field1,field2,field3,field4 which is a date field how can i get the most current of the field?
any suggestion? TIA
You can use Max funtion to get most recent date for each field and compare them to get the absolte most recent.
Many, many ways to accomplish this I'm sure...
This will work:
Code:Select Max(X1.DateField)
From (Select Max(Field1) "DateField" From SomeTable
Union All
Select Max(Field2) From SomeTable
Union All
Select Max(Field3) From SomeTable
Union All
Select Max(Field4) From SomeTable) "X1"
thanks all. yes i do get the most current date now thanks