I have a SQL database (Redshift) full of Unix Epoch times in milliseconds.
I'm trying to create a macro where the user can select the start date and end date from a calendar interface tool in a human readable format, then those inputs will modify a filter on the Unix Epoch column to select everything between 12:00:00:00 AM on the start date (The first possible millisecond), all the way up to 11:59:59:999 PM on the end date (the last possible millisecond). So the filter includes everything from the days selected.
I've created a macro that looks like this:

The two calendar inputs modify the start date and end date values in the filter. The code in that filter looks like this:
"unix_time_column" >= DATEDIFF(millisecond,{d '1970-01-01'},'start-date') and "tb_h" <= DATEDIFF(millisecond,{d '1970-01-01'},'end-date')
My dates are formatted as YYYY-MM-DD, and the calendar filters update them, and the DATEDIFF code changes the user input to Unix time. However, when I run this macro, it seems like I'm missing some entries. How can I build this so that it takes all the proper entries?
If I get this working right, I will publish this macro in a larger post for the community to use.
Thanks!