Thnks in advance
Hi,
getdate() function sets the date with curent time along with it,i need to select the largest date with largest time (mean most recent entry among set of entries with same date)
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Madhu KRank #1,514 · 1.1K reputationPosted Dec 28, 2010, 1:30 AM EST
select top 1 date_column from tablename order by date_column desc
Manikavelu VelayuthamRank #413 · 6K reputationPosted Dec 28, 2010, 1:32 AM EST
Date range
January 1, 1753, through December 31, 9999
Time range
00:00:00 through 23:59:59.997
These are the maximum date and time range that sql server supports.
Pradeep W2 reputationPosted Dec 28, 2010, 2:55 AM EST
In SQL Server you can have a column of datatype datetime or timestamp and use getdate function to store the entry time for that record.
Now to get the latest entry record you can use the query
Select Top 1 column_name From TableName order by column_name desc
here column_name is the name of the column of datatype datetime or timestamp