cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Difference between two dates.

Huskar
Participant
0 Likes
277

I want to fetch all price row which have difference of start date and end date greater than 10 days. How can I do that?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Hi Krishn,

Please try below query:

 SELECT *
 FROM {PriceRow as p}
 WHERE {p.endTime} > {p.startTime} - INTERVAL 10 DAY

The PriceRow extends PDTRow which has startTime/endTime fields instead of startDate/endDate.

Hope this helps.
Best Regards,

VinayKumarS
Active Contributor
0 Likes
 If the database is oracle..
 
 select * from {PriceRow} where to_date( {starttime},'dd-MM-yyyy')>=to_date(sysdate-10,'dd-MM-yyyy')
Former Member
0 Likes

I think that Krishn asked about start-end date difference and your query works on difference between start date and current date (which might be different than end date).