Skip to Content
0
Former Member
Dec 03, 2009 at 04:25 PM

No records being returned in report

33 Views

I'm in the middle of converting an old VB6 database with reports designed in Crystal Reports 8.5 into VB.NET 2008 and whatever version of Crystal Reports is integrated with it.

I have six reports and the first two I did are working okay. The next two, though, are leaving me scratching my head trying to figure out what is wrong.

Basically, they are not returning any records even though the query is valid. I pass the report a condition in the RecordSelectionFormula property. When the report comes up in the viewer nothing but the titles and section headers are displayed.

To make sure that the query is correct, I go into the CR designer, right-click on the report to bring up the context menu, and then select Report -> Selection Formula and enter the condition directly into the editor. Next, I right-click on "Database Fields" and then select "Show SQL Query" which has the WHERE clause containing the condition I just entered. I then paste this query into Microsoft SQL Server Development studio. When I run the query I get the records that I expect.

My condition that I'm passing to the report is:

{ACI_APL_TY_CD.Description} = 'Drug' AND ISNULL({ACI_APL_ACTN.Exp_Date}) AND ({Main_Partcpnt.TRS_POSTMARK_DATE} >= date('12/3/2000') AND {Main_Partcpnt.TRS_POSTMARK_DATE} <= date('12/3/2009'))

Can anyone think of a reason why this is happening?

Thanks for any assistance.