getting weekday from a day

Hi all,it is me again.Since there is no builtin function in KDB/Q to retrieve the weekdayfrom a day, i have built my own version.w:{ {xweekday} ([] num:til 7;weekday:sunmondtueswednthursfrisat ) x mod 7) }Any more elegant solution available?Regards,Kim

not that i am aware of.
could be done without a table like in

{satsunmondtueswednthurs`fri@x mod 7} .z.d+til 10

{satsunmontuewedthufri x mod 7}On Feb 22, 8:01?am, kuentang <kuent...> wrote:&gt; Hi all,&gt;&gt; it is me again.&gt;&gt; Since there is no builtin function in KDB/Q to retrieve the weekday&gt; from a day, i have built my own version.&gt;&gt; w:{ ?{xweekday} ( num:til 7;> weekday:sunmondtueswednthursfri`sat ) ?x mod 7) }>> Any more elegant solution available?>> Regards,>> Kim</kuent…>

{satsunmontuewedthufri x mod 7}On Feb 22, 8:01?am, kuentang <kuent...> wrote:&gt; Hi all,&gt;&gt; it is me again.&gt;&gt; Since there is no builtin function in KDB/Q to retrieve the weekday&gt; from a day, i have built my own version.&gt;&gt; w:{ ?{xweekday} ( num:til 7;> weekday:sunmondtueswednthursfri`sat ) ?x mod 7) }>> Any more elegant solution available?>> Regards,>> Kim</kuent…>

That’s what I get for using the web interface to Google Groups…