Re: Converting a date to a string
Posted in 1998
Bob Neidecker wrote: > How do I convert a date to a string so that I can have the following where > clause > > WHERE date_column LIKE '12/%1/98' > > I want users to be able to use wildcards in strings. I know there is a > performance hit. Since you cannot do a like on a date column you must > first convert it to a string using some sort of string conversion operator. > I am new to Informix but in Oracle the where clause would look like > > WHERE TO_CHAR(date_column ,'MM/DD/YYYY') LIKE '12/%1/1998'. > > In sybase it would look like > > WHERE convert(char(10), date_column, 101) LIKE '12/%2/1998' > > Bob Neidecker > bob_neidecker@mail.amsinc.com > > Try this ... WHERE date_column::CHAR(10) LIKE '12/%2/98' Check out the "INFORMIX Guide to SQL: Tutorial" - chapter 13. HTH, Avi. ************************************************************************ /\\ \\ /| Avi Abrami, Analyst/Programmer, Telegate Ltd. /__\\ \\ / | 7 Haplada Street, Or-Yehuda, ISRAEL / \\ \\/ | Phone:+972-3-5388717 Fax:+972-3-5335877 eMail:avia@telegate.co.il