CF UDF countArbitraryDaysExcluding

My countArbitraryDaysExcluding UDF has been released on You can find it here:

See the comments there. But basically, count all the days in a date range (eg all Mondays) but exclude certain dates (eg for public holidays). These exclusions may be specific dates or patterns ( eg YYYY-1-1 ) – New Years Day in any year so you dont need to update your code once a pattern is defined.

Using an OR in a MySQL Select If statement

It took a while to find the (sort of) obvious. I needed a Select statement that used the IF function and wanted the condition part to have an OR in it.

The standard syntax is:

if (condition, do this if true, do this if false)


if (questions.type='F', concat(a,b,c), concat(a,b,c,d,e) )

with an OR

if (questions.type='F'||questions.type='G', concat(a,b,c), concat(a,b,c,d,e) )