I've made the following change to the syntax of the query. But now I have another issue. Because I have a variable (int _val) and assigned it to 0, thats the only value thats being returned, 0. Whatever I assign _val to, whether 0 or 100, it outputs that value. It is not being used properly in my code. I'll have to trace through some more.
In the same sense, if I don't assign it to a value at the top, of course I get an error when I use it at the bottom right before the curly beacket in the "Try" function. (Error: Use of unassigned local variable '_val'
So, yes, I'll have to trace through to see what the issue is.
Thanks for your help though.
------------------
I actually just realized my own mistake in why I wasn't getting the wrong value. My query wasn't returning anything because there was no data in it. A database change, (that I wasn't aware of) had occurred where we are migrating data to and from different tables. Database 101, make sure the table you are querying has data in it. lol
But again, thanks for your assistance on everything.