What Day is it in Informix?
Posted in 1999
Topics: Platform-Specific Issues, Versions, Editions & End-of-Life
Folks - (IDS 7.30UC5 on Solaris) This one should be obvious to me, and it isn't ... therefore, it's an Informix omission. ;-) All I want to do is take a datetime field and determine what day of the week it is - Sunday, Monday, etc. Thanks all! Rich -- Richard C. Auslander Database Manager AirFlash, Inc. 1733 Woodside Rd., Suite #110 Redwood City, CA 94061 (650) 556-7928 www.airflash.com
The functioRichard Auslander <rich@airflash.com> wrote: > (IDS 7.30UC5 on Solaris) > > This one should be obvious to me, and it isn't ... therefore, it's an > Informix omission. ;-) Really??? :-> > > All I want to do is take a datetime field and determine what day of the > week it is - Sunday, Monday, etc. The function WEEKDAY wll give you back the number if the weekday (1 to 7), or was it (0 to 6): select WEEKDAY(datetimefield) ... Tested with: DB-Access Version 7.31.UC2. Have a look to Informix Guide to SQL Syntax, Expressions, Time Functions ;-) Reinhard
Richard Auslander wrote: > Folks - > > (IDS 7.30UC5 on Solaris) > > This one should be obvious to me, and it isn't ... therefore, it's an > Informix omission. ;-) > > All I want to do is take a datetime field and determine what day of the > week it is - Sunday, Monday, etc. > > Thanks all! > > Rich > > -- > Richard C. Auslander > Database Manager > > AirFlash, Inc. > 1733 Woodside Rd., Suite #110 > Redwood City, CA 94061 > (650) 556-7928 > > www.airflash.com Use the function weekday(datetime_variable) -- Compliments of QueriX -------------------------------------------------------------------------------------------------- QueriX 4GL Compilers are Informix 4GL Compatible. Some features are: True Windows GUI Clients. ActiveX support. HTML Report Generation. More rigorous error handling. Connection to other RDBMS such as Oracle. Connection to all versions of Informix 4GL with no need to change compiler. For more details visit: http://www.querix.com/ ---------------------------------------------------------------------------------------------------
Try the following; select DECODE(weekday(some_date), 0,'Sunday', 1,'Monday', 2,'Tuesday', 3,'Wednesday', 4,'Thursday', 5,'Friday', 6,'Saturday') from some_table Richard Auslander <rich@airflash.com> wrote in message news:3834C9F6.82856838@airflash.com... > Folks - > > (IDS 7.30UC5 on Solaris) > > This one should be obvious to me, and it isn't ... therefore, it's an > Informix omission. ;-) > > All I want to do is take a datetime field and determine what day of the > week it is - Sunday, Monday, etc. > > Thanks all! > > Rich > > -- > Richard C. Auslander > Database Manager > > AirFlash, Inc. > 1733 Woodside Rd., Suite #110 > Redwood City, CA 94061 > (650) 556-7928 > > www.airflash.com > >