I am struggling to get this query to run I have a custom date field and want to select those entries that are for a specific year ie 2010:
{exp:query sql="
SELECT field_id_14 as Comp_date, field_id_15 as Competition, field_id_16 as Winner, SUBSTRING(field_id_17, 13) as Image,
field_id_18 as Caption, field_id_19 as Section
FROM exp_channel_data WHERE channel_id = '37' AND DATE_FORMAT(field_id_14, '%y') = '2010' AND field_id_19='Gents Golf'
ORDER BY field_id_14 ASC"}However the above query returns no results even though I know I have 35 records that match; I know the problem is with the DATE_FORMAT(field_id_14, ‘%y’) = ‘2010’ bit Any ideas ? thanks PS I am running 2.1.1 and PHP 5.2.12
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.