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 2008 Forums
 Transact-SQL (2008)
 MOD %

Author  Topic 

micnie_2020
Posting Yak Master

232 Posts

Posted - 2012-02-07 : 09:16:42
Hi All

If i do i%4, i get result set 4, 8, 12, 16
If i do i%5, i get result set 5, 10, 15, 20

What formula shall i used to generate 5, 9, 13, 17?

Please Advise.

Thank you.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-02-07 : 09:26:52
[code] i%4 + 1[/code]
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-02-07 : 09:33:04
quote:
Originally posted by sunitabeck

 i%4 + 1



[LIKE]


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -