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.
| Author |
Topic |
|
jpfo
Starting Member
7 Posts |
Posted - 2005-10-13 : 09:42:22
|
| Hi all,I want to make a query condition to get all values in a numeric type field that are multiples of 5.I've no ideia how can i put this in work... help needed with the condition, pls.Best regards to u all m8. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-13 : 09:45:04
|
| Select yourColumn from yourTable where yourColumn % 5 = 0MadhivananFailing to plan is Planning to fail |
 |
|
|
jpfo
Starting Member
7 Posts |
Posted - 2005-10-13 : 09:56:40
|
| i remember u the field is numeric.Trying:SELECT * from MyTableWhere MyField % 5 = 0The result is:Operand type clash: int is incompatible with void typeOperand data type numeric is invalid for modulo operator. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-13 : 10:15:13
|
| Try thisSelect yourColumn from yourTable where cast(yourColumn as int) % 5 = 0MadhivananFailing to plan is Planning to fail |
 |
|
|
jpfo
Starting Member
7 Posts |
Posted - 2005-10-13 : 10:25:36
|
| tks, work fine |
 |
|
|
|
|
|