[SOLVED] SQL action to modify subscription expiry date

14 years 10 months ago - 13 years 6 days ago #97062 by vade27
My website's subscription period runs from 1 June to 31 May, regardless of when the member subscribes. This is not available by default so I suppose I will have to use some SQL integration actions to modify the expiry.

As per advice from Beat, I have used a yearly NON-calendar setting for this plan, so now I need an SQL action query to change the expiry_date in jos_cbsubs_subscriptions to the 31 May preceding the date which gets computed automatically.

Can anyone help or at least give me some pointers on how to develop this query?

Thanks in advance!

Please Log in to join the conversation.

14 years 8 months ago #104604 by eirikop
Something like this should work, but the year should be dynamic. I'll see if I can figure that out later.

update jos_cbsubs_subscriptions set expiry_date=STR_TO_DATE('31.5.2010 23:59:59','%d.%m.%Y %k:%i:%s') where user_id=[user_id];

Please Log in to join the conversation.

13 years 1 week ago #158021 by AlexRag
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.189 seconds

Facebook Twitter LinkedIn