Is it possible to use below query in supabase JS
select * from visas where current_date - country_arrival_date >= 30;
g
garyaustin
05/25/2023, 8:43 PM
Turn it around so you do .lt('country_arrival_date', JScalculated30daysago).
Or something along those lines.
z
zerefati
05/26/2023, 3:21 PM
I mean current_date MINUS (-) country_arrival_date >= 30;
g
garyaustin
05/26/2023, 3:22 PM
Either way you just need to do the fixed math (current_date and 30) and compare that properly against country_arrival_date column.
garyaustin
05/26/2023, 3:24 PM
You can't do math on the column itself in the API. But you should be able to get a formula that works. You can always call and rpc function and do the SQL if you prefer.