Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering by Even Numbers

Status
Not open for further replies.

KIDDIE

Programmer
Feb 11, 2002
5
US
SELECT
ACCOUNT_NUMBER,
EM_NO + IN_BANK + NT_BANK AS SPA,
CURRENT_BALANCE,
CYCLE_CODE_99

FROM
dbo.NANOMASTER_CUR
WHERE
((EM_NO + IN_BANK + NT_BANK) IN
('502650000000', '851190000000')) AND
(CURRENT_BALANCE between 1600 AND 5000)and
CYCLE_CODE_99 in(2,4,6,8,12,14,16,18,20)
 
Just use the modulo operator (%) and check to see if the result is 0 or 1.

Modulo divides one number by another and displays the remainder. Ex. 6 % 2 is 0, but 5 % 2 is 1. All even numbers will have 0 as the remainder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top