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)
 HELP translating

Author  Topic 

smithani
Starting Member

42 Posts

Posted - 2007-09-06 : 16:39:13
Hi,
I am trying to translate this foxpro stuff into Tsql with no luck.
Apparently there is no calculate function and arrays in tsql

I want to write this in TSQL
calculate max(times) to m.times for inlist(status,'K','T','M','N') and !
expired.

How do i loop thru and find max for each inlist member.

Any help will be greatly appreciated.

Thanks

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2007-09-06 : 16:57:35
Will this do? I don't know foxpro, but this will give the max of the column "Times" from the table "yourtable"

SELECT [status],max(times)
from yourtable
where [status] in ('K','T','M','N')
group by [status]

Jim
Go to Top of Page

smithani
Starting Member

42 Posts

Posted - 2007-09-07 : 00:00:54
yes, thanks so much.
Go to Top of Page
   

- Advertisement -