|
-
Aug 24th, 2000, 05:54 AM
#1
Thread Starter
Hyperactive Member
txtItemPrice must be a numeric on my form
How will I add this to my database or do calculations on it, ensuring that it is saved as numeric and not as text....
Insert into database....
insert into client values txtItemPrice
or
insert into client values " & txtItemPrice & "
or
???
Calculations....
intTotal = txtItemPrice + txtItemVat
or
intTotal = "txtItemPrice" + "txtItemVat"
or
????
-
Aug 24th, 2000, 06:06 AM
#2
Fanatic Member
When inserting into your database, if you want it to go in as numeric then use INSERT INTO Client VALUES txtItemPrice.
When calculating (I'm presuming you're using integers due to what you've call your variable) then you would use the following ...
Code:
intTotal = CInt(txtItemPrice.text) + CInt(txtItemVat.text)
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Aug 24th, 2000, 11:30 AM
#3
Frenzied Member
Usually taxes and prices have dollars and cents (or pick you favorite currency and fractinal part, thereof). For that reason, I'd use CCUR instead of CINT
-
Aug 24th, 2000, 11:50 AM
#4
Fanatic Member
I would usually use CCur instead of CCint as well. I only used CInt as turfbults naming of variables indicates that he is using integers.
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|