View Single Post
  #1  
Old May 19th, 2010, 09:56 PM posted to microsoft.public.access.queries
RyNC
external usenet poster
 
Posts: 11
Default Updating text field to new numeric field & moving minus sign to fr

Hi,

I need some help with the below IF statement for update query. I got it to
move the negative sign to the front of the number, but now it is removing all
numbers after my decimal point. I've checked to make sure my formatting for
[MyNumericField] is double and 2 decimal points.

For example:

[MyTextField] is 23.32-

I run update query and....

[MyNumericField] is -23


Here is what I have for the update query:

UPDATE [MyTable] SET [MyTable].[MyNumericField] =
IIf(Right([MyTextField],1)="-",-CLng(Left([MyTextField],Len([MyTextField])-1)),CLng([MyTextField]))

Thanks,
RyNC