Days(360)
Posted in 2000
Topics: General Discussion
Hi, all. There's built-in function in Microsoft products for time calculation, where year is regarded as having 360 days and month has 30 days. As parameters it receives start of the period (date), end of the period (date) and it it returns number of days. AS I know, Informix doesn't have such function, but maybe somebody knows, where to get such function or SP? Thanks in advance! Andris
the function you describe does not sound all that accurate. you would be better off writing your own in sp, or if you use 4gl use the built in date and day functions... as you noted, if you had the use of a udr, you could use it inside an sql statement. Andris wrote: > Hi, all. > > There's built-in function in Microsoft products for time calculation, > where year is regarded as having 360 days and month has 30 days. > As parameters it receives start of the period (date), end of > the period (date) and it it returns number of days. > > AS I know, Informix doesn't have such function, but maybe somebody > knows, where to get such function or SP? > > Thanks in advance! > Andris
Only Micro$oft could come up with the concept of a 360 day year. I guess it's the new Windoze Year TM and will become standard across all software :-) Anyway ranting aside, SQL can do the trick: SELECT (DATE('01/03/2000') - DATE('01/02/2000')) UNITS DAY FROM systables WHERE tabid = 1 should do what you want. It even works out leap years correctly! Put it in a SP accepting two dates and returnng one integer and Robert is your Mothers Brother Cheers Tricky Andris <andris.shirons@dati.lv> wrote: > >Hi, all. > >There's built-in function in Microsoft products for time calculation, >where year is regarded as having 360 days and month has 30 days. >As parameters it receives start of the period (date), end of >the period (date) and it it returns number of days. > >AS I know, Informix doesn't have such function, but maybe somebody >knows, where to get such function or SP? > >Thanks in advance! >Andris > > > ----------------------------------------------------------- Got questions? Get answers over the phone at Keen.com. Up to 100 minutes free! http://www.keen.com