SQL Query - Sage Intelligence - Custom Container

Greetings SI & SQL Gurus!  

I built customer SI containers for tables containing UDFs as part of a larger project. Some of those UDFs are date fields, which are typically null. This doesn't present a challenge for Sage, SQL, or the custom Crystal Reports I developed. However, the container is confused by null values. No surprise, of course...

So I added a new, custom SQL Expression to the container, instead, and provided the below expression:
SELECT DISTINCT [SO_SalesOrderDetail].[UDF_CUSTOMER_PO_DAT] FROM [SO_SalesOrderDetail] WHERE [SO_SalesOrderDetail].[UDF_CUSTOMER_PO_DAT] IS NOT NULL ORDER BY [SO_SalesOrderDetail].[UDF_CUSTOMER_PO_DAT]
However, this pulled exactly the same bad data for the null fields; namely, the -53688 value we all know to well. The only difference between the Sage data expression and my new SQL expression is the highlighted portion.
Can anyone help me on my SQL syntax or approach to this data call in Sage Intelligence?

Cheers,
James
  • 0

    Hi - Ran into the SQL Date issue on a report I built last year.

    What I did was let the Null Date export to the Raw Data sheet.

    The report used a Pivot Table pulling from the Raw Data. For the Date column I used Conditional Formatting when Date = -53688 changed the text color to match the cell background color so in essence it appeared  blank.

    Don't know if this is your issue but thought I'd throw this out there.

    Doug