Skip to content

How to query for rows between two dates ? #856

Answered by jqnatividad
slonyik asked this question in Q&A
Discussion options

You must be logged in to vote

And to directly answer your question @slonyik , here's the luau command that uses the LuaDate library:

qsv luau filter -x \
'local date = require "date";tr_date = date(time_received);lower_date = date("2023-02-10 11:40:06");higher_date = date("2023-02-11 12:17:00");return tr_date >= lower_date and tr_date <= higher_date' \
data.csv

and the result is:

id,state,time_received
36462310-a899-71ed-0028-8a2540b40000,CLOSED,2023-02-10 23:18:22.444
7368680c-a899-71ed-055a-8a2503eb0000,CLOSED,2023-02-10 23:20:06.013
867cdd24-a899-71ed-055a-8a2503eb0000,CLOSED,2023-02-10 23:20:38.025
fa2b3720-a899-71ed-034f-844009280000,CLOSED,2023-02-10 23:23:50.889
1be17924-a89a-71ed-1b58-8a8732150000,CLOSED,2023-…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@jqnatividad
Comment options

@slonyik
Comment options

Answer selected by jqnatividad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants