I am trying to extract records older than 2 years.
I have this in my read data control
Note that '' around
Tried all I can think of but NBG.
It works OK if I 'hard code' a value. For example
I must be missing something again.
😡
Nick
I have this in my read data control
id/IN:{var:read_data43}but that forces this SQL
YEAR ( lastvisitDate )/>=:(YEAR( CURDATE() )-1)
SELECT `mdlSelectReceiversOnReceipt`.`id` AS `mdlSelectReceiversOnReceipt.id`, `mdlSelectReceiversOnReceipt`.`username` AS `mdlSelectReceiversOnReceipt.username`
FROM `u3a_users` AS `mdlSelectReceiversOnReceipt`
WHERE `mdlSelectReceiversOnReceipt`.`id` IN ('1113', '591', '3362', '1876', '595', '2013', '3355', '1115', '3363', '592', '3356', '3360', '2869', '2120', '2149', '2148', '3364', '590', '2440', '', '582', '2607', '2654', '2648', '2826', '2868', '2875', '2872', '3091') AND
YEAR ( lastvisitDate ) >= '(YEAR( CURDATE() )-1)' ORDER BY `mdlSelectReceiversOnReceipt.username` ASC LIMIT 100000;
Note that '' around
'(YEAR( CURDATE() )-1)'
Tried all I can think of but NBG.
It works OK if I 'hard code' a value. For example
YEAR ( lastvisitDate )/>=:2018
I must be missing something again.
😡
Nick