1704578 - Date (0,0,0) is removed from SQL statement when report is executed in Visual Studio 2008 or Visual Studio 2010 application

SAP Knowledge Base Article - Public

1704578 - Date (0,0,0) is removed from SQL statement when report is executed in Visual Studio 2008 or Visual Studio 2010 application

Symptom

When a record selection formula is used to filter data and a Date(0,0,0) is used in the formula it is removed when processed through CR .NET SDK at runtime.

Environment

  • Visual Studio 2008
  • Visual Studio 2010

Reproducing the Issue

When a record selection formula with a Date(0,0,0) is used the report runs in Crystal Reports Designer.

When the report is executed in a Visual Studio application the SQL is altered as follows:

Original record selection formula:
(({@Stop Date} = Date (0,0,0)) or({@Stop Date} >= CurrentDate))
 
When the formula is retrieved in .NET app the following is retrieved and executed:


({@Stop Date} = OR ({@Stop Date} >= CurrentDate))

Cause

This is a known issue and has been tracked as ADAPT01580384.

Resolution

  • In Crystal Reports 2008, this issue has been addressed in Service Pack 4 with Fix Pack 4.2
  • In Crystal Reports for Visual Studio 2010, this issue has been addressed in Service Pack 3

Keywords

date(0,0,0), Crystal Reports 2008, Crystal Reports for Visual Studio 2010, record selection formula , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio ; SAP Crystal Reports, version for Visual Studio .NET 2008