how we can calculate difference b/w two dates?



IBM's flagship relational database management system

how we can calculate difference b/w two dates?

Postby ebreddy » Fri Jul 02, 2010 12:16 am

i am facing problem how we can find difference b/w current date and stored date(which was entered into table)
ebreddy
 
Posts: 3
Joined: Sun May 09, 2010 6:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how we can calculate difference b/w two dates?

 

Re: how we can calculate difference b/w two dates?

Postby ebreddy » Fri Jul 02, 2010 1:43 am

if dob, cur_date columns of table

select cur_date - dob as age from tablename
ebreddy
 
Posts: 3
Joined: Sun May 09, 2010 6:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how we can calculate difference b/w two dates?

Postby Manikavasan » Wed Oct 27, 2010 12:48 pm

SELECT DAYS(CUR_DATE - DOB) FROM TABLENAME.
Hope it will work.

Thanks
Manikavasan.R
Manikavasan
 
Posts: 3
Joined: Mon Oct 25, 2010 12:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how we can calculate difference b/w two dates?

Postby dick scherrer » Thu Oct 28, 2010 12:48 am

Hello,

It may work - we won't know because the request is quite non-specific. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post