Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 622
  • Last Modified:

Adding number to text field

I have a field [Transaction Number] that is formatted as a text field. The value is 000002. I need to add the number 231955 to the value from a query and have it display 231955.

When I use the formula FormatNumber(CInt([Transaction Number]),0,0,0)+[CurrentTransNumber] in the query I get 2231955.

When I use the formula FormatNumber(CInt([Transaction Number]),0,0,0)+CInt([CurrentTransNumber]) I get a stack overflow error.

How do get it to add and not combine text values?
0
PetGuy
Asked:
PetGuy
1 Solution
 
Rey Obrero (Capricorn1)Commented:
change "CInt" to "Clng"
0
 
Gustav BrockCIOCommented:
You could simply use:

Format(Val([Transaction Number]) + Val([CurrentTransNumber]), "000000")

/gustav
0
 
PetGuyAuthor Commented:
Just what I needed, and fast
0
 
als315Commented:
In query you should be able to sum numeric text values and number without conversions.
[Transaction Number] + 231955 will be equal 231957 if [Transaction Number] equal 000002 or 002
0
 
hnasrCommented:
"need to add the number 231955 to the value from a query and have it display 231955.", where is the effect of value 000002?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now