I.T. Discussion Community!
-Collapse +Expand
Access
Search Access Group:

Advanced
-Collapse +Expand Access To/From
To/FromCODEGuides
-Collapse +Expand Access Store
PRESTWOODSTORE

Prestwood eMagazine

April Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyMicrosoft Access BoardMS Access Interactive Topic   Print This     

Access takes SQL numbers as strings - help!

Access takes SQL numbers as strings - help! in MS Access Interactive topic (part of our Microsoft Access group).

Quick Search: numbers   strings   Access takes   Access takes SQL   numbers strings  
BigMrC
 (Inactive)
-- USA
I have a SQL view taking a column of numbers from one table and dividing by 2.2046, and another view that's doing the same on another table.
When I feed these views through into Access and have a form that displays the values, and a text box which sums them, the text box is treating them as strings.
eg if the first total is 100 and the second total is 50 instead of showing the result as 150 it shows it as 10050.
I have tried converting at the SQL end to decimal and int, converting via a query at Access end using CInt, and still Access will not add them together as numbers.
Can anyone shed some light here?
thanks
 Posted 18 years ago (Thread Starter)
Comment Quote
About BigMrC -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9647, 3 replies
Thread Started 5/22/2003 4:57:00 AM
View Counter=2483
Location=-- USA 
Joined=20 years ago   MB Posts=8  
jdschram
MN
It really does seem odd that it would contantenate instead of adding...without seeing code, make sure you are using + not &, you can also try this syntax to convert strings to integers.
sum = cint("100") + cint("50")
 Posted 18 years ago
Comment Quote
About jdschram -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #9652 (Level 1.1)  Reply to 9647
Thread Started 5/22/2003 6:26:00 AM
View Counter=2
Location=MN  
Joined=20 years ago   MB Posts=259  
Most Recent Post
BigMrC
 (Inactive)
-- USA
thanks for replies, sorry I wasn't clearer. I just managed to fix it - the code that was putting the values in the text boxes after update of a combo was using nz which somehow was converting them to text instead of making them zero if null, never seen that before, fixed now though.
 Posted 18 years ago (Thread Starter)
Comment Quote
About BigMrC -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9654 (Level 1.2)  Reply to 9647
Reply Posted 5/22/2003 8:13:00 AM
Location=-- USA 
Joined=20 years ago   MB Posts=8  
Daniel Fought
Prestwood IT
Home office in Fresno, CA.
Just a guess, are you displaing the results of your SQL in Text boxes on the form and then attempting to sum those results in a third text box? If so this behavior is understandable in that the displaied value in a text box is text..
Again it is very important to explain not only what you want to accomplish in an application but also what code you have attempted.

Dan Fought
Senior Programmer Analyst
Prestwood IT Solutions
http://www.prestwood.com

 Posted 18 years ago
Comment Quote
About Daniel Fought -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Daniel Fought
Danial Fought is a senior programmer analyst with Prestwood IT where he develops custom Windows software and custom websites. When Dan is not coding for clients, he participates in this online community. Coding specialties include Paradox/ObjectPAL, MS Access, Visual Basic, and VS.Net/VB.Net.

Post ID #9653 (Level 1.3)  Reply to 9647
Reply Posted 5/22/2003 6:47:00 AM
Location=Home office in Fresno, CA. 
Joined=19 years ago   MB Posts=401   KB Posts=12   KB Comments=4  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1111A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #9647 Counter
2483
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2021 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech