Skip to main content
1-Visitor
April 14, 2020
Solved

How to get last 5 days and 24 Days data in posgres with one service

  • April 14, 2020
  • 1 reply
  • 947 views

I have one service which has one input as period I put days value it give error but when put it hardcode values then it works fineCapture.PNG

Best answer by raluca_edu

Hi,

 

Try this:

 

select "Date","Temp"

from public."Temperature" where "Date" between (now()-[[period]]::interval) and now();

 

On my end is working fine.

 

Hope it helps,

Raluca Edu

1 reply

17-Peridot
April 14, 2020

Hi,

 

Try this:

 

select "Date","Temp"

from public."Temperature" where "Date" between (now()-[[period]]::interval) and now();

 

On my end is working fine.

 

Hope it helps,

Raluca Edu

yasmalik1-VisitorAuthor
1-Visitor
April 14, 2020

Thank you so much 🙂 It's working