Reputation: 143
How do I make both of these WHERE statements be satisfied please?
where("cast(strftime('%d', date) as int) = ?", month)
where("cast(strftime('%Y', date) as int) = ?", year)
Something like:
where("cast(strftime('%d', date) as int) = ?", month) AND
where("cast(strftime('%Y', date) as int) = ?", year)
I have tried a few ways but can't get it working.
Thanks
Upvotes: 0
Views: 38
Reputation: 13487
You can use multiple question marks:
where("cast(strftime('%d', date) as int) = ?
AND cast(strftime('%Y', date) as int) = ?", month, year)
Or just use 2 where
statements:
where("cast(strftime('%d', date) as int) = ?", month)
.where("cast(strftime('%Y', date) as int) = ?", year)
Upvotes: 1