Thanks for the response. =)
I'm sorry,
I have several fields which I would like to perform the same operation on.
I didn't pasted the error message produced by the code.
It's supposed to be:
Must declare the scalar variable "@Type"
The error message was for:
int count = new Select().From(tblSchema).Where("Deleted & 2").IsEqualTo("2").GetRecordCount();
What I'm trying to accomplish here is putting several values into one field. For example, the value for Deleted field could be:
- 1 = Deleted by receiver
- 2 = Deleted by sender
- 4 = Deleted by administrator
So, if both receiver and sender have deleted the records, the Deleted value would be 3.
As for the Type column, I have 1, 2, 4, 8, 16, 32, 64, and 128.
I could have put it on another table and used many-to-many relationship, but I thought this was simpler.
The SQL query I'd like do produce is something like:
SELECT * FROM items WHERE Deleted & 2 = 2
That's why I can't use Where(tbl.TypeColumn).