We are getting a problem in one query..
str = "Update SetDeduction set PFD = ' " + TextBox1.Text + " ' where PFD < ' " + TextBox1.Text + " ' And PFD <> ' 0 ' "
We found out that the query is partially working. We want that the PFD value gets updated for those employees who have non-zero value but not for those employees who have higher value of PFD willingly(for eg..20% instead of 12%).
When we run the code, it recognizes that which values are zero and which are non-zero (i.e., this part is working : PFD<> ' 0 ' ) but this part is not working : PFD < ' " + TextBox1.Text + " '
Is there any problem with the AND operator or the < operator ?
Also, in the tables we have PFD value as text so is this creating problem ? We tried this also :
Dim a As Integer a = Convert.ToInt32(TextBox1.Text) str = "Update SetDeduction set PFD = ' " + TextBox1.Text + " ' where PFD < ' " + Convert.ToInt32(TextBox1.Text) " ' And PFD <> ' 0 ' "
but this also doesn't work.
Similarly we made tried converting the PFD also to integer by using OleDbDataReader but it did not work.
No errors are shown.
Can anyone help regarding this ?