SQL problem - CURTIME(), SYSTIME(), and SYSTIMESTAMP() bug?

Posted by Admin on 09-Feb-2011 12:16

First of all, I'm new to this forum. If this is not the right place to post OpenEdge SQL questions, please help point me in the right direction, thanks!

I'm using OpenEdge 10.1C, trying to collect database usage data using the following query:

    SELECT CURDATE() AS 'ConnDate'
            , CURTIME() AS 'ConnTime'
            , COUNT(*) AS 'ConnCount'
        FROM "PUB"."_Connect"
        WHERE "_Connect-Type" = 'REMC'
            AND "_Connect-Device" <> '';

If the aggregate COUNT function returns a value >= 1, the result is:

2011-02-09;09:59:54;1;

If the aggregate COUNT function returns a value = 0, the result is:

2011-02-09;<NULL>;0;

Why does CURTIME() return NULL if the COUNT(*) is 0????????? I still need it to return the time!

I tried substituting the SYSTIME() and SYSTIMESTAMP() functions with the same result. Is this a bug?

Also, I find it strange that even if COUNT(*) is zero, CURDATE() still returns a date, but CURTIME() doesn't return a time...

Thanks!

All Replies

This thread is closed