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 2005 Forums
 Transact-SQL (2005)
 Need sql logic

Author  Topic 

vipin_jha123
Starting Member

31 Posts

Posted - 2011-06-24 : 05:49:04
I have a query
i need to select a column on the basis of given derivation logic
like i need to
select DCTD_ACLI.tran_particular from DCTD_ACLI on the bais of MAX(DCTD_ACLI.tran_date) and DCTD_ACLI.part_tran_type='D'

please advise with proper sql statement

thankx and regards,
Vipin jha

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-06-24 : 06:30:57
select d.tran_particular
from DCTD_ACLI d
where d.part_tran_type='D'
and d.tran_date = (select max(tran_date) from DCTD_ACLI)





==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -