Select on special datefield

You are missing a feature or need an enhancement? Post your suggestion here!
Post Reply
Frans
Posts: 24
Joined: 12 Dec 2015 13:15
Select on special datefield

Post by Frans »

Hello Bernd,

Is it possible to ad datefield(s) at the TAGdata or Trackdata or somewhere else from which a selection can be made?
Let me explain.

Let's say that september 21 it's the birthday of Britney Spears, Madonna and Justin Bieber.
I want to be able to place an advanced filter on a line in the Script Library Editor.
The filter will be something like "And [SpecialDate] = today".

So september 21 when this scriptline is picked, Britney, Madonna or Justin are Random / LeastRecently / etc chosen.
And only filter on day and month because next year at the same date the same artists must pop up.

Thanks
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Select on special datefield

Post by radio42 »

Couldn't you already use an existing field, eg. the [Comment] field?
And then use the contains filter with the existing date macros ${dd} and ${MM}?

Eg. you comment field might contain the text "SpecialDay=21.09."
And you are then filtering if the comment contains this value using the above macros.

That should work already today. And wouldn't require any new fields.
Frans
Posts: 24
Joined: 12 Dec 2015 13:15
Re: Select on special datefield

Post by Frans »

This works, partially, for me.

I have filled some commentfields with the line Geboortedag1=24.09.

I'm not an script wizard, but i think it must be something like:

Code: Select all

Contains([Comment], 'Geboortedag1=${dd}') And Contains([Comment], 'Geboortedag1=${MM}') Or Contains([Comment], 'Geboortedag2=${dd}') And Contains([Comment], 'Geboortedag2=${MM}')
This doesn't work, so i tried:

Code: Select all

Contains([Comment], 'Geboortedag1=${dd}')
This works. The tracks that include Geboortedag1=24.09. are selected.
and i tried

Code: Select all

Contains([Comment], 'Geboortedag1=${MM}')
This doesn't work. The tracks that include Geboortedag1=24.09. are not selected.

What am i doing wrong here?

I have checked my computer date and my network date. They both read 24-09-2016 ;)
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Select on special datefield

Post by radio42 »

As your comment line is for example "Geboortedag1=24.09." it seems it contains the DAY (${dd} macro) and the MONTH (${MM} macro).
As such your filter should be something like this (note the dots as well):

Code: Select all

Contains([Comment], 'Geboortedag1=${dd}.${MM}.')
Frans
Posts: 24
Joined: 12 Dec 2015 13:15
Re: Select on special datefield

Post by Frans »

Yes,
That works.

Thank you Bernd.

Post Reply