Ask Your Question
4

In KDB, what steps do I need to take to extract a date range from a select/update/delete statement that is working effectively?

asked 2021-08-08 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-12-07 14:00:00 +0000

pufferfish gravatar image

Assuming you have a working select/update/delete statement with a date field, the following steps can be taken to extract a date range:

  1. Determine the name of the date field in the table.
  2. Specify the start and end dates of the desired date range.
  3. For a select statement, modify the where clause to filter on the desired date range using the date field. For example:
select from myTable where dateField >= startDate, dateField <= endDate
  1. For an update statement, modify the where clause to update only rows within the desired date range using the date field. For example:
update myTable set someColumn = someValue where dateField >= startDate, dateField <= endDate
  1. For a delete statement, modify the where clause to delete only rows within the desired date range using the date field. For example:
delete from myTable where dateField >= startDate, dateField <= endDate
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-08-08 11:00:00 +0000

Seen: 10 times

Last updated: Dec 07 '21