user3045496
user3045496

Reputation: 129

Using Where-Clause in a query

I'm having problems with a Where query. It doesn't seem to work or its not right

select * from FP where FP.Paid Amount => '100' 

I'm trying to only display the people who have paid over 100 in the DB

Any Ideas?

Thanks

Upvotes: 1

Views: 79

Answers (2)

alzaimar
alzaimar

Reputation: 4622

Reverse the '=' and the '>'. Also, a @ of the leading '"' will prevent the compiler from trying to translate any of the string content.

string myQuery = @"select * from FP where FP.Paid Amount >= '100' ";

Upvotes: 0

Yandros
Yandros

Reputation: 732

Did you mean to do this?

string myQuery = "select * from FP where FP.[Paid Amount] >= '100' ";

Note that => and >= are not the same.

By the way, if [Paid Amount] is a numeric column, you'll want to drop the single quotes, like this

string myQuery = "select * from FP where FP.[Paid Amount] >= 100 ";

Upvotes: 4

Related Questions