getting weekday from a day

345 views
Skip to first unread message

kuentang

unread,
Feb 22, 2011, 8:01:30 AM2/22/11
to Kdb+ Personal Developers
Hi all,

it is me again.

Since there is no builtin function in KDB/Q to retrieve the weekday
from a day, i have built my own version.

w:{ {x`weekday} ([] num:til 7;
weekday:`sun`mond`tues`wedn`thurs`fri`sat ) x mod 7) }

Any more elegant solution available?

Regards,

Kim


wp

unread,
Feb 22, 2011, 8:56:27 AM2/22/11
to personal...@googlegroups.com
not that i am aware of.
could be done without a table like in

{`sat`sun`mond`tues`wedn`thurs`fri@x mod 7} .z.d+til 10

> --
> You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
> To post to this group, send email to personal...@googlegroups.com.
> To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.
>
>

Aaron Davies

unread,
Feb 22, 2011, 1:16:49 PM2/22/11
to Kdb+ Personal Developers
{`sat`sun`mon`tue`wed`thu`fri x mod 7}

Aaron Davies

unread,
Feb 22, 2011, 6:07:57 PM2/22/11
to Kdb+ Personal Developers
That's what I get for using the web interface to Google Groups....

On Tuesday, February 22, 2011, Aaron Davies <aaron....@gmail.com> wrote:
> {`sat`sun`mon`tue`wed`thu`fri x mod 7}
>
> On Feb 22, 8:01 am, kuentang <kuent...@vodafone.de> wrote:

> --
> You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
> To post to this group, send email to personal...@googlegroups.com.
> To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.
>
>

--
Aaron Davies
aaron....@gmail.com

Aaron Davies

unread,
Feb 22, 2011, 1:19:47 PM2/22/11
to Kdb+ Personal Developers
{`sat`sun`mon`tue`wed`thu`fri x mod 7}

On Feb 22, 8:01 am, kuentang <kuent...@vodafone.de> wrote:
Reply all
Reply to author
Forward
0 new messages