Avatar of richardbarlow
richardbarlow

asked on 

Update query has to find all odd numners

I need an update query to modify all records with odd numbers. The field containing the numbers is called TAG and they are all whole numbers.

How do I detect odd or even in a query?
Microsoft AccessVisual Basic ClassicSQL

Avatar of undefined
Last Comment
richardbarlow
Avatar of Cem Türk
Cem Türk
Flag of Türkiye image

Select * from tablename where ((fieldName%2)=1) 'gets odd numbers
Select * from tablename where ((fieldName%2)=0) 'gets even numbers
Avatar of richardbarlow
richardbarlow

ASKER

I'm getting a syntax error. Access doesn't like the %

I'm using this in SQL view:

SELECT tblCatalogue.TAG
FROM tblCatalogue
WHERE (((tblCatalogue.TAG%2)="1"));
ASKER CERTIFIED SOLUTION
Avatar of Shanmuga Sundaram D
Shanmuga Sundaram D
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of richardbarlow
richardbarlow

ASKER

Thank you - spot on
Avatar of Cem Türk
Cem Türk
Flag of Türkiye image

sorry, my code works on SQLExpress 2005 :) thought it works for you too :]
Avatar of richardbarlow
richardbarlow

ASKER

worked great with the mod entry. now i have another question re odd/even which i'll post in a minute or so
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo