Skip to content
Advertisement

Using two sets of conditions in where clause

I’m trying to get the count of items in my table where it should satisfy these conditions

I’m trying to use this statement but I’m pretty sure it’s messed up.

I also tried this to no avail

Advertisement

Answer

Your code should work. I would write this as:

Note: The ? is for a parameter so you are not munging the query string with input values.

If I had to guess why this isn’t working, I would speculate that one or both of the dates have a time component. You might try:

to be sure you are matching on the date, regardless of time.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement