How to get max value in sql

Answered How to get max value in sql

  • Friday, February 01, 2013 3:04 PM
     
     

    hi.

       may i ask q question.

       in c# we can do like this  DateTime.MaxValue,to get max value of datetime,i would like to ask if in sql server there is a code  to realize it?thank u very much

    best regards

    martin


All Replies

  • Friday, February 01, 2013 3:10 PM
     
     Answered Has Code

    Did you try 

    Declare @maxdate as datetime = '9999-12-31'

    • Marked As Answer by martinwang1985 Friday, February 01, 2013 3:28 PM
    •  
  • Friday, February 01, 2013 3:28 PM
     
     

    thank u very much Venkat786

    it works