RE: Selecting date in given format
Posted in 1999
Topics: SQL Development & Query Writing
to_char is also available from 7.30 (we Have 7.30.UC3) select to_char(today,'%Y-%m-%d') o/p is 1999-03-11 Girish Kagrana(girishk@infogain.com) > -----Original Message----- > From: SUHAS TEMBE [SMTP:stembe@email.msn.com] > Sent: Thursday, March 11, 1999 4:37 PM > To: informix-list@iiug.org > Subject: Re: Selecting date in given format > > Huy, > > You could write a select statement (without changing the DBDATE variable) > as > follows : > > select year(date_field) || '-' || extend(date_field, month to month) || > '-' > || > extend(date_field, day to day) > from table > > Hope this solves your problem. > > Suhas > > > Honza Pazdziora wrote in message ... > >Hello, > > > >I'm searching for a way to select a date field in some nice format. > >What is the equivalent of Oracle's > > > > select to_char(date_field, 'yyyy-mm-dd') from table > > > >that forces the output string have format 1999-03-10, instead of the > >default 99-03-10. I want to stay in pure SQL for this task. > > > >Any hint would be apprecited, > > > >-- > >------------------------------------------------------------------------ > > Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/ > > make vmlinux.exe -- SGI Visual Workstation Howto > >------------------------------------------------------------------------ > > >