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)
 Only get max record

Author  Topic 

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2007-09-28 : 12:58:40
I have syslogins and i want to check table that may have

USER DATE COMPANY empl
TRACEY 01/01/2007 1 018
TRACEY 01/01/2006 9 017

Could have two records for employee

Tried
select NAME,
A.EMPL_ID,
A.FIRST_NAME,
A.LAST_NAME,
A.TERM_DT
FROM
syslogins
where SUBSTRING(A.FIRST_NAME,1,1) + a.LAST_NAME = name
in (select max(a.term_dt) from EMPLOYEE a)

Erroring on
STATEMENT in

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-09-28 : 13:01:00
>>where SUBSTRING(A.FIRST_NAME,1,1) + a.LAST_NAME = name
in (select max(a.term_dt) from EMPLOYEE a)

I have no idea what you are trying to do here?? Can you explain?

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -