Re: ESQL/C datetime comparison question
Posted in 1998
Arun (arun@accentsoftware.com) wrote: > This has been a negging question for me for a while. Is there a > way to compare two datetime or interval fields in ESQL/C to figure > out which of the two is greater than the other (i.e. later than > the other)? If the qualifiers are the same (eg both DATETIME YEAR TO SECOND), then you can use deccmp() on the two decimals which are part of the datetime type. If the qualifiers are different, you can probably still use deccmp() for the comparison, but you need to verify this. Similar comments apply to intervals with the same qualifier; intervals with different qualifiers are not, in general, compatible enough to do this. You should also check the datetime/interval section of your ESQL/C manual to see whether there's a comparison function mentioned in there. yours, Jonathan Leffler (jleffler@earthlink.net) #include <many-aliases.h>