0
$query = (new Query())
        ->select([])
        ->from(['{{%custom_table}}'])
        ->where(['<=','firstDate', now()])
        ->all();

In craft3, I want to add multiple conditions in the where statement of the above query so that it work as similar as following:

WHERE firstDate <= now() AND lastDate >= now() AND entryId=$entryId

Note: Please confirm that the function now() works in the query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.