Customize WHERE condition

Customize a WHERE condition to use a dynamic year offset.

Overview

The condition needs to calculate the year based on the current date plus two months, which cannot be done directly in the standard WHERE field.
Create a PHP action to calculate the target year and return it. Then, reference the returned value in your CF read data action using the designated variable placeholder.

Answered
ChronoForms v7
cm cmwincom 23 Dec, 2025

I have a WHERE condition in a read data action that is currently

IFKbm.518year = {date.site:Y}

Is it possible to make it so the WHERE condition returns the year of the current date + 2 months?

Max_admin Max_admin 24 Dec, 2025
Answer

Better use a PHP action and return the value then use {var:php-action-name}:

return date('Y', strtotime('+2 months'));
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply