Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Richard Auslander (IDS 7.30UC5, Solaris) asked how to get the day of the week from a datetime field. Reinhard Habichtsberg and QueriX 4GL / Mehdi pointed to the WEEKDAY function. michael talbot added a DECODE on weekday() mapping 0-6 to Sunday-Saturday. No confirmation from the poster, but the answers were consistent.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Richard Auslander — — source: Informix-list mailing list archive (1991-1998)
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
↪ replying to Richard Auslander
QueriX 4GL / Mehdi — — source: Informix-list mailing list archive (1991-1998)
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/
---------------------------------------------------------------------------------------------------
↪ replying to Richard Auslander
michael talbot — — source: Informix-list mailing list archive (1991-1998)
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
>
>
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.