View Single Post
Newbie Member
5May2009,11:21  
rishumakan's Avatar
Thanks for replying..the query you mailed me gave some error like :

Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "t1.bid" could not be bound.
Msg 8155, Level 16, State 2, Line 1
No column was specified for column 1 of 't3'.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "t1.bid" could not be bound.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'edate'.

but this query :

select t1.bid, t1.name, t2.ename, t2.edate,(select count(*) from tbl2 t4 where t4.bid = t1.bid) as total_Cnt
from tbl1 t1,tbl2 t2 where t1.bid = t2.bid
and t2.edate = (select max(edate) from tbl2 t3 where t2.bid = t3.bid)

worked fine for me..might be i need to do some changes in your query as u didn't have access for making tables.Thanks again for replying.