Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Select Newest date (max?)

Author  Topic 

rwaldron
Posting Yak Master

131 Posts

Posted - 2009-10-29 : 11:27:51
Hi all,

I have a table with numerous dates.
eg date1,date2,date3,date4,date_conpleted

I'll looking to calculate number of days from which ever date is the most recent date from date1,date2,date3,date4 to date_completed..

I Think I can use MAX but usually this is only on 1 column.
I want Max date from either of the 4 columns?

Any ideas?

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2009-10-29 : 11:46:04
Try using a Case if you can give the table structure and expected results then it will be easy to help.

========================================
Project Manager who loves to code.
===============
Ask to your self before u ask someone
Go to Top of Page
   

- Advertisement -