Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!aramis.rutgers.edu!paul.rutgers.edu!yes.rutgers.edu!emuleomo From: emuleomo@yes.rutgers.edu (Emuleomo) Newsgroups: comp.databases Subject: Apparent Date calculation bugs in Ingres!! Message-ID: Date: 21 Jul 89 13:26:43 GMT References: <25638@shemp.CS.UCLA.EDU> <3185@rtech.rtech.com> Distribution: usa Organization: Rutgers Univ., New Brunswick, N.J. Lines: 25 I seem to have run into a very insidious bug when doing date calculations in Ingres. The problem is this. When I do a date calculation that should return a negative number, it sometimes returns zero!! This happens spuriously. e.g. the ESQL/C statement EXEC SQL SELECT date('20-jul-1989')-date('22-jul-1989') INTO :Date_buf1 from a_table; will return "0 days" or "-2 days" intermitently. However, EXEC SQL SELECT date('22-jul-1989')-date('20-jul-1989') INTO :Date_buf1 from a_table; will ALWAYS return "2 days". Ingres GURUS, what is going on here?? E-mail will be greatly appreciated. --Emuleomo O.O. (emuleomo@yes.rutgers.edu) -- ** Research is what I'm doing when I dont know what I'm doing! **