SDyke Posted July 10, 2008 Share Posted July 10, 2008 In my report I have two date columns. I need a column that will show the difference in days between these two date columns. Please help. Link to comment Share on other sites More sharing options...
peter.galeingres.com Posted July 10, 2008 Share Posted July 10, 2008 First a word of warning. You may get problems with these calculations when the timezone you are in has Daylight Saving. The calculation relies on all days having 86400000 milliseconds but some days have more or less than that at the start and end of DST.If your Timestamps are pure dates (time is 00:00:00) then there wont be a problem as the answer will be in whole days anyway. new Long (($F{d1}.getTime()-$F{d2}.getTime())/86400000) That should do the trick.If you are retrieving from an SQL database then you should be able to do this in SQL. For example in Ingres you can do interval('days',date1 - date2) Peter GaleIngres Corporation Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now