How do I calculate number of days between the to dates strictly using HQL alone.
supposing Current_Date
and Expiry_Date
are two dates fetched from database. I want to calculate days between Current_Date
and Expiry_Date
.
Also, How will I handle, if any of the value is null
?
I figured an solution for my issue.
(extract(doy from bp.qhrIqamaexpirDate)-extract(doy from now()))
doy
represents The day of the year (1 - 365/366).