Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Max(attempt_date) in the where clause

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-11-05 : 08:18:09
Navinderjit writes "I am having table 'Attempt' with field:
emp_id, test_id, session_name, attempt_number, attempt_date

Now I need "test_id, session_name, attempt_number, attempt_date"
for a particular emp_id where his attempt_date is MAX.

I need someting like (some how):
Select test_id, session_name, attempt_number, attempt_date from test_attempt where <u>attempt_date=max(attempt_date)</u> and test_id in (137,138,139,140,141,142,247,257,259,266,267,270,271,273,274,275,276,277,278,289) and datepart(mm,test_attempt_date)='10'

I don't want to use Subquery for a particular reason.

Thanks in advance.."

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-11-05 : 09:45:51
echo off

Jay White
{0}
Go to Top of Page
   

- Advertisement -