Re: [SQL] Datetime conversion in WHERE clause

2004-09-09 Thread Josh Berkus
Philippe, > Is there a way to force the date conversion to fail sliently, and simply > return a null in case the parameter is not a valid date? You'd need to write a custom function, using an external language that allows you to test for valid date values. I prefer using PL/perlU with Date::M

[SQL] Datetime conversion in WHERE clause

2004-09-09 Thread Philippe Lang
Hello, I'm converting a varchar to a date in a search routine which looks like: -- CREATE FUNCTION public.search_data(varchar) RETURNS SETOF foo1 AS ' SELECT DISTINCT foo1.* FROM foo1 LEFT JOIN foo2 ON foo2.fk = foo1.pk WHERE lower