Thanks for your update
I found a way to find date difference calcuation
The below expression converts the jde julian date to normal date.
Then the difference can be calculated as
These statements solved my problem and now the days are calculating perfectly.
I havent tried the similar case in QUERY/400.
But, I found a solution by searching it in google.
You can find the way to do the same(with sample code) in above link.
Hope, it will help you.