Hi all,
I've been trying to use the moment function in the Transformer of an SQL query for days now and for some reason it won't work. The weird thing is, I contacted support that showed me a screenshot of a query that worked which I copied and pasted with no luck.
Is there a very simple way to get the difference between 2 dates in the transformer ?
Here is my code so far (that doesn't work):
NB : the SQL query gets a table with a column called "golive" that has one date in it
let myDate = new Date();
let d1 = moment(myDate);
let d2 = moment(data['golive'][0]);
let difference= Math.abs(d2-d1);
let result = difference/(1000 * 3600 * 24)
return result
Even when I do this, I get a "now rows to display" :
let myDate = new Date();
let d1 = moment(myDate);
return d1
Any ideas as to why that won't work ?
Thanks !