Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtracting Variables

Status
Not open for further replies.

mikecx

Technical User
Jul 9, 2002
215
US
How do you subtract a constant from a variable? I am pulling a number from my db ( Rs(0) ) and trying to subtract that number from 50. So far, i have failed. Below is my attempt. Help!

Fullset = 100
Recset = Rs(0) 'In this case = 50
Unset = (Fullset - Recset)

( should return 50 ;) )
 
try
Unset = (CInt(Fullset) - CInt(Recset))

Cint function convert data type to a integer.
---------------------------------------
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee");alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top