Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Max() function

Status
Not open for further replies.

Naoise

Programmer
Dec 23, 2004
318
IE
How does Max() actually work? MSDN says it works on datetime fields, is there something I am missing?

tblSent :
ID1(Identity) | ID2(Integer) | SentDate(DateTime)
1 2 2005-03-22 10:27:25.000
1 2 2005-04-06 10:27:09.000


SELECT MAX(CONVERT(varchar, SentDate, 103)) as SentDate FROM tblSent
WHERE ID1 = 1
AND ID2 = 2


gives

SentDate
22/03/2005

Why is this?

Thanks for replies
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top