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!

Update odd or even records

Status
Not open for further replies.

kristinac

Programmer
Jul 18, 2003
98
US
I need to update address records based on whether the address is odd or even. Is this possible? I have not found the syntax. Basically I want to say:

UPDATE Addresses
SET StreetId = 2
WHERE StreetId = 3
AND Address >= 1
AND Address <= 4197
AND [Address is ODD]

Is this totally ridiculous or possible?

Any help would be appreciated. Thanks! :)
 
Assuming that "Address" is numeric
[blue][tt]
UPDATE Addresses
SET StreetId = 2
WHERE StreetId = 3
AND Address >= 1
AND Address <= 4197
AND Address MOD 2 = 1
[/tt][/blue]
 
Thanks very much Golom! I was working with MOD but I had the syntax all wrong.

Thank you! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top