Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community, I had a time stamp field with AM and PM values. and my requirement is to fetch the data between previous day 10 PM to current day 9.59 PM. Please help to do it in script level. field name is TIMESTAMP_TAREWT
Sample data attached for your reference.
Hi @sudhir0538 , please check if this script works for you :
be carefull with the variables, because i had problems with the comma as decimal separator, but it works!
Let vBegin = num(today()-1) + 0.916666666666667;
Let vEnd = num(today()) + 0.916666666666667;
LOAD
LADLENO,
GROSSWT,
TAREWT,
NETWT,
TAPNO,
TIMESTAMP_GROSSWT,
TIMESTAMP_TAREWT
FROM [C:\Users\fquez\Desktop\Raw_data.xlsx] (ooxml, embedded labels, table is Sheet1)
Where
TIMESTAMP_TAREWT >= $(vBegin) and TIMESTAMP_TAREWT <= $(vEnd)
;
Hi @sudhir0538 , please check if this script works for you :
be carefull with the variables, because i had problems with the comma as decimal separator, but it works!
Let vBegin = num(today()-1) + 0.916666666666667;
Let vEnd = num(today()) + 0.916666666666667;
LOAD
LADLENO,
GROSSWT,
TAREWT,
NETWT,
TAPNO,
TIMESTAMP_GROSSWT,
TIMESTAMP_TAREWT
FROM [C:\Users\fquez\Desktop\Raw_data.xlsx] (ooxml, embedded labels, table is Sheet1)
Where
TIMESTAMP_TAREWT >= $(vBegin) and TIMESTAMP_TAREWT <= $(vEnd)
;
Hello @QFabian , Thank you for the solutions. It worked pretty well.
Please explain those 2 variables and the constant value. TIA.
Sure @sudhir0538 ,
Let vBegin = num(today()-1) + 0.916666666666667;
Today() -1 (yesterday) : 19-01-2020
as a number : 43.849
hour : 22:00
as a number, is the decimal part : 0,916667
So, when you sum both 43.849 + 0,916667 --> 43849,916667 and if you show it as a timestamp :
19-01-2020 22:00
Let vEnd = num(today()) + 0.916666666666667;
today() : 20-01-2020
as a number : 43.850
hour : 22:00
as a number, is the decimal part : 0,916667
So, when you sum both 43.850 + 0,916667 --> 43850,916667 and if you show it as a timestamp :
20-01-2020 22:00