0

I was able to use where clause like the first one. But I get an error message when I tried to add "IS_SUBMITTED == FALSE". What do I do? IS_SUBMITTED is boolean type.

(Working)

    dsRequestList.Where = @"REQUEST_DETAIL_TYPE_ID.Contains(""" + RequestID + @""") AND  
APPROVAL_GROUP_ID.Contains(""" + ApprovalID + @""")  AND CREATE_DT >= DateTime.Parse(""" + 
FromDate + @""") AND CREATE_DT <= DateTime.Parse(""" + ToDate + @""")";

(Error) dsRequestList.Where = @"IS_SUBMITTED == """ + "False" + @""" AND REQUEST_DETAIL_TYPE_ID.Contains(""" + RequestID + @""") AND APPROVAL_GROUP_ID.Contains(""" + ApprovalID + @""") AND CREATE_DT >= DateTime.Parse(""" + FromDate + @""") AND CREATE_DT <= DateTime.Parse(""" + ToDate + @""")";

1 Answer 1

1

Are you using "=" or "=="?

Also, doesn't this:

@"IS_SUBMITTED == """ + "False" + @""" ...

evaluate to this:

@"IS_SUBMITTED == ""False"" ...

i.e. you're actually comparing IS_SUBMITTED to the string "False" instead of False.

Sign up to request clarification or add additional context in comments.

3 Comments

I changed as "IS_SUBMITTED == FALSE"
(I tried this way, but got same error) dsRequestList.Where = @" REQUEST_DETAIL_TYPE_ID.Contains(""" + RequestID + @""") AND APPROVAL_GROUP_ID.Contains(""" + ApprovalID + @""") AND CREATE_DT >= DateTime.Parse(""" + FromDate + @""") AND CREATE_DT <= DateTime.Parse(""" + ToDate + @""") AND IS_SUBMITTED == ""false""";
That's still comparing IS_SUBMITTED with a string. Try ending it with AND IS_SUBMITTED == FALSE";.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.