By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,837 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

SQL - Eliminating duplicates from a table

P: 1
Please help.

I have table with 7 columns and 2 rows. All the data in the columns and rows are exactly the same except the activity date column which has the date and time stamp. ex(10/14/2005 1:10:39PM) on row1 and .(10/14/2005 1:10:40PM) on row2....How do I select the max activity date based on the timestamp.
May 4 '06 #1
Share this Question
Share on Google+
1 Reply

P: 135
Use "Select Max(datefield) as MaxDate from yourTable"

With Microsoft programs, (Access, MS Sql) Date and time are stored as a number.
(12345.67890) Left side is the date, right side is the time. 000001.000001 (or something like that) is 1/1/1900 at Midnight 000002.000001 would be the next day so Max(datefield) will give you the highest number.

At least I assume it should work, I've used Max() before but not with a date.

Hope that helps

Your post title is "Eliminating duplicates from a table" but you question is different.
May 4 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.