Re: Time studies
Posted in 1997
On 5 Jun 1997, Pat O'Connor wrote: > I have a number of rows in a table that contain a column defined as: > datetime hour to minute With you so far. > I want to be able to count the number of rows (total the dollars) in a > 5-minute increment (or any other minutes increment). Well, counting and totalling are different, but you can figure that out: DEFINE f_early_dtim DATETIME hour TO minute DEFINE f_late_dtim DATETIME hour TO minute LET f_early_dtim = "09:00" LET f_late_dtim = "17:00" SELECT SUM(mystery_column) FROM mystery_table WHERE datetime_field BETWEEN f_early_dtim AND f_late_dtim [ insert error checking here ] > I have Informix SE 4.1 with ISQL & R4GL. This should work for you. Although I confess that I didn't know Informix had implemented datetimes in SE4. Well, you learn something new every day. :=) > Can anyone help me with query syntax? Let me know if this fails to work for you. -Richard