Actually, I think that first SQL query works as it should, but second doesn't. I am not sure if MS Jet/Access supports similar expressions with multiple joker symbols inside of the string. Maybe this is something specific only with the SQLite. But, instead of Like '2008-%-%' you could write just Like '2008-%'.nynaevelan wrote:Any idea why this:
will not work as this?Code: Select all
<Group|Name:Statistics>\December 2008|Filter:<Date last played> Like '%-12-%'\<Genre>
Code: Select all
<Group|Name:Statistics>\December 2008|Filter:<Date last played> Like '2008-%-%'\<Genre>
MM is really missing RegExp function with SQL queries, with it all of this could be possible and many more. You know, they are added Sin function to SQL, but not RegExp - I am just wondering who really wants such function as Sin with multimedia database. And if they implemented Sin, why they didn't implemented also Cos, Tan, Ln, Log, ...

Anyway, if you want to extract some part of date value, you could try it with SQLite date functions, instead of Like operator (http://www.sqlite.org/lang_datefunc.html). For example strftime('%m', <field_name>) would return a month. and strftime('%Y', <field_name>) would return a year part of date field. So, if you want to get all tracks played in 2008, you could write:
Code: Select all
<Group|Name:Statistics>\Played in 2008|Filter:strftime('%Y', <Date last played>) = '2008'\<Genre>
Code: Select all
<Group|Name:Statistics>\Played in 2008|Filter:strftime('%Y', Songs.LastTimePlayed) = '2008'\<Genre>