When you use try to filter a view by date (in postgres) you end up with a query filter like
(TO_CHAR(TO_DATE(node_data_field_date_availible.field_date_availible_value, 'FMYYYY-FMMM-FMDDTFMHH:FMMI:FMSS'), 'YY-MM-DD') >= '2008-11-28')
which causes a problem because 2008-11-28 is of the form YYYY-MM-DD.

Easiest way to fix this is to change sql_format() in date_api_sql.inc where you have
'Y' => 'YY', 'y' => 'Y',
change the line to
'Y' => 'YYYY', 'y' => 'Y',

patch attached

Thanks,
Steven H. Noble

CommentFileSizeAuthor
date_api_sql.inc.diff456 bytessnoble

Comments

yched’s picture

Project: Content Construction Kit (CCK) » Date
Version: 6.x-2.1 » 6.x-2.x-dev
Component: Views Integration » Miscellaneous

Moving to Date module - date fields handle their own integration with Views.
Please specify which exact version of Date you're using.

karens’s picture

Status: Active » Fixed

OK, fix committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.