Author |
Topic |
cognos79
Posting Yak Master
241 Posts |
Posted - 2008-09-30 : 13:16:19
|
Is there a user defined function that returns the difference between two dates descriptively:St date: 01/01/2008end date: 09/15/2008 as 0 years, 8 months, 15 days... |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-09-30 : 13:28:19
|
If by "defined" you mean a built in sql function, then no. You would have to write your own or find for one that someone else has already written.Be One with the OptimizerTG |
|
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2008-09-30 : 13:31:23
|
I am trying to find if anybody has already written a function that does it... |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-30 : 13:42:08
|
only upto days or even time difference upto seconds? |
|
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2008-09-30 : 13:42:39
|
just until days... |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-09-30 : 14:41:23
|
This can be tricky...I think you'll need to define some reqirements.Given these dates should you get the same result?St date: 01/12/2008end date: 09/15/2008 or is it: 0 years, 8 months, 3 dayswhat should be the results for these dates:St date: 12/29/2007end date: 1/28/2008 0 year, 0 months, 30 days ?St date: 2/29/2008end date: 3/29/2008 (0 year, 1 months, 0 days) or (0 years, 0 months, 29 days) or ?Be One with the OptimizerTG |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2008-09-30 : 16:31:20
|
peso...does it take leap year into account. the function written by you. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-30 : 16:32:57
|
What were your test-results? E 12°55'05.63"N 56°04'39.26" |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2008-09-30 : 16:57:47
|
I will test it...thanks guys. |
|
|
|