current_timestamp in SQL for target group

Use this forum for questions regarding adoption and functionality of OpenEMM

Moderator: moderator

jhagstrand
Posts: 22
Joined: Thu Apr 17, 2008 8:38 pm

current_timestamp in SQL for target group

Post by jhagstrand »

Hi,

I created a date-based mailing, and a target group with a rule of cust.created = current_timestamp. The mailing seems to run at the correct time and it never sends any emails.

The document says, "When processing the rule, the system replaces the [current_timestamp] keyword by the current date." The log entry below displays that keyword built into the SQL SELECT, without replacement.

The text in the SELECT is the same as what is on file in the dyn_target_tbl table: date_format(cust.created, '%Y%m%d') ='current_timestamp-1'

That is not valid SQL and that explains why no recipients are selected to receive the mailing.

Can you see what I am doing wrong?
Where in the system is that current_timestamp keyword replaced with the current date?
Thanks
John

[21.04.2008 17:00:00] INFO/execute/(1/21/37/219): Start creation of mails

[21.04.2008 17:00:00] DEBUG/dbase/(1/21/37/219): DB-Exec: SELECT cust.customer_id, bind.user_type,cust.mailtype,cust.email FROM customer_1_tbl cust, customer_1_binding_tbl bind WHERE bind.customer_id = cust.customer_id AND (bind.mailinglist_id = 21 AND (bind.user_status = 1 AND ( ( date_format(cust.created, '%Y%m%d') ='current_timestamp-1' ) OR ( date_format(cust.created, '%Y%m%d') ='current_timestamp' ))))

[21.04.2008 17:00:01] INFO/writer/(1/21/37/219): End block 0