SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 max date
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

seeker61
Starting Member

4 Posts

Posted - 05/16/2013 :  08:59:08  Show Profile  Reply with Quote
I have two dates for a record 9/30/2012 and 8/31/2014 and max(datevalue) returns 9/30/2012 --- why

mmkrishna1919
Yak Posting Veteran

India
94 Posts

Posted - 05/16/2013 :  09:11:19  Show Profile  Reply with Quote
Please check the data type of that column may be it is in VARCHAR()

Thanks,

M.MURALI kRISHNA
Go to Top of Page

seeker61
Starting Member

4 Posts

Posted - 05/16/2013 :  09:18:33  Show Profile  Reply with Quote
That did it thanks.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 05/17/2013 :  00:08:47  Show Profile  Reply with Quote
ALways try to use proper datatype for fields. Otherwise you will have difficulty in doing manipulations like these and would require unnecessary convert operations

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000