sqlt-sqlcrystal-reportscrystal-reports-xi

What does the Date(0000,00,00) function equal in a SQL environment?


I am converting a Crystal Report into a SQL query. I have an IF statement in Crystal where

if {loanview.FUNDING_DATE} <> Date(0000,00,00)....

Is Date(0000,00,00) a current date? Because I see a CurrentDate function as well


Solution

  • After some googling, I found this following definition of Date(0000,00,00)-

    The special “zero” date '0000-00-00' can be stored and retrieved as '0000-00-00'. When a '0000-00-00' date is used through Connector/ODBC, it is automatically converted to NULL because ODBC cannot handle that kind of date. ... MySQL permits you to store dates where the day or month and day are zero.

    To me, it might be a checking which is something like-

    if {loanview.FUNDING_DATE} <> NULL
    BEGIN
        --Place necessary operation when the date is not NULL
    END
    

    Note: This is not a confirmed solution/answer. I just sharing my opinion and you can implement the above logic in SQL and check both part - Report and Query output shows same result or not.