Categories > TinyButStrong general >

If..then on Date Field

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Anthony
Date: 2011-02-24
Time: 15:53

If..then on Date Field

Is it possible to use a conditional on a date field. For example, I tried this, but it does not appear to work:

[eventsblock.begindate;if [eventsblock.begindate] = now;then 'Today']

The begindate field is a date field, not a timestamp. Instead of displaying something like Thursday, February 24, 2011 when the date is today, I want to display Today, February 24, 2011. Obviously, I can do within the PostgreSQL database procedure with case statements, but I wonder if TBS has a way to accomplish this at the time of display.
By: Skrol29
Date: 2011-02-24
Time: 20:51

Re: If..then on Date Field

Hi Anthony,

You can use something like this:
[eventsblock.begindate;frm=yyyy-mm-dd;if [val]=[onload..now;frm=yyyy-mm-dd];then 'Today']
Parameter "frm" is precessed before parameter "if".