Determine if number is even or odd

  • Thread starter Thread starter SGURDON
  • Start date Start date
S

SGURDON

I am creating a query and I need something similar to the
Excel ISODD function. I have a string and depending on
whether a certain part is even or odd us essential. A
sample string is A 101-155-E. I need a way to determine
if the "155" is even or odd. I am dealing with about 5000
of these strings and they need to be divided by the even
and odd, among other things. I have been taking the file
into Excel to do this but would like to do it all in
Access.
Thanks
 
I am creating a query and I need something similar to the
Excel ISODD function. I have a string and depending on
whether a certain part is even or odd us essential. A
sample string is A 101-155-E. I need a way to determine
if the "155" is even or odd. I am dealing with about 5000
of these strings and they need to be divided by the even
and odd, among other things. I have been taking the file
into Excel to do this but would like to do it all in
Access.
Thanks

You have 2 problems to resolve.
1) separate the 155 from the balance of the field data.

2) Determine if it's even or odd

Exp: IIf(Val(Mid([FieldName],InStr([FieldName],"-")+1)) Mod
2=0,"Even","Odd")
 
Back
Top