SQL statement in vb.net

  • Thread starter Thread starter herewegoagain
  • Start date Start date
H

herewegoagain

Guest
Does anyone see anything here that I am missing? For some reason it is not returning the results it is suppose to.

sql2 = "SELECT * FROM STOCK WHERE ONHAND + ONORDER < RESERVE ORDER BY NUMBER"

stock is table name
onhand is field
onorder is field
reserve is field
number is field and primary key.
Please help thank you.....
 
nope

didnt work.....any other ideas?
I cant beleive this it should be so simple.
One piece of information that I didnt give before is that the fields are of float variety except for number.
 
Try telling us what it is or isnt doing. Error message? "not returning the results it is suppose to" isnt very enlightening.
 
sorry. it is not returning any results at all though I know that should not be the case. I know this is incorrect because I manually went in and looked through an excel formula to do the calculation to test the program results.
Here is the code of that event procedure and again thank you for your help....
 
Might try chucking the formula in some parenthesis. Order of operations could be messing things up. This is just an uneducated guess.
Code:
SELECT * FROM STOCK WHERE ((ONHAND + ONORDER) < RESERVE) ORDER BY NUMBER
 
Back
Top