Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate a date range in kdb excluding weekend days?

Tags:

kdb

This code produces a sequence of dates:

firstdate: 2008.06.01
lastdate: 2008.08.31
daterange: firstdate + til (lastdate - firstdate) + 1

Is it possible to generate the same range excluding weekend dates (Sat/Sun)?

like image 431
Robert Kubrick Avatar asked Apr 20 '13 01:04

Robert Kubrick


1 Answers

q)daterange where not (daterange mod 7) in 0 1 
2008.06.02 2008.06.03 2008.06.04 2008.06.05 2008.06.06 2008.06.09 2008.06.10 ..
q)
like image 161
user1895961 Avatar answered Oct 08 '22 17:10

user1895961