DATETIME/INTERVAL Conversions
Posted in 1993
Joe, Regarding dividing intervals.... yes you can do it in i4gl, but you will need to convert your interval first. For instance, if you have an interval including different units (eg. 3 days 4 hours and 15 minutes) you can convert it all into a total number of minutes as follows: { 3 days } define day_char char (10) define day_minutes integer let day_char = interval (3) day to day { convert interval to a string } let day_minutes = day_char { string to numerical conversions work so long as conversion is valid } let day_minutes = day_minutes * 24 { hours } * 60 { minutes in an hour } Anyway, doing this for each set of units and adding your result units together will give you a total number of minutes in your interval. Now that you have an integer, you should be able to get whatever percentages you want out of it. Hope this helps! Cathy +-------------------------------+----------------------------------------+ | Cathy Kipp | Internet: ckipp@vth1.vth.colostate.edu | | Veterinary Teaching Hospital | | | Colorado State University | Voice: (303) 491-1294 | | Fort Collins, CO 80523 | Fax: (303) 491-1205 | +-------------------------------+----------------------------------------+