SirPaladin
Programmer
This may just be the last straw before I give up on using Crystal Reports and design my own report designer. It seems that when I define a record set for the report that includes the SQL 'Like' statement, it doesn't report the records and comes up blank. Is Crystal Reports incapable of working with the statement? Is there a work-around? Here's my SQL statement (Saved in variable ReportSQL$):<br>
<br>
SELECT * FROM [Companies] WHERE [Companies].[RecordDate] >= #1/1/98# AND [Companies].[RecordDate] <= #10/8/99# AND [Companies].[Industry] Like '*Recruiter*' ORDER BY [Company]<br>
<br>
And here's how I'm calling the report:<br>
<br>
Dim rs As New ADODB.Recordset<br>
<br>
If Len(ReportSQL$) = 0 Then<br>
MsgBox "Recordset not selected yet. Use the Query form first"<br>
Unload Me<br>
End If<br>
<br>
'Use this SQL statement to select the records to use<br>
rs.Open ReportSQL$, _<br>
"DSN=" & DSN$ & ";", adOpenKeyset<br>
Report.Database.SetDataSource rs<br>
<br>
CRViewer1.DisplayGroupTree = False<br>
CRViewer1.ReportSource = Report<br>
CRViewer1.ViewReport<br>
<br>
When I send it SQL statements without the 'Like' clause, it works fine, but that's not good enough. Anyone have a clue? Anyone know of a better report designer?
<br>
SELECT * FROM [Companies] WHERE [Companies].[RecordDate] >= #1/1/98# AND [Companies].[RecordDate] <= #10/8/99# AND [Companies].[Industry] Like '*Recruiter*' ORDER BY [Company]<br>
<br>
And here's how I'm calling the report:<br>
<br>
Dim rs As New ADODB.Recordset<br>
<br>
If Len(ReportSQL$) = 0 Then<br>
MsgBox "Recordset not selected yet. Use the Query form first"<br>
Unload Me<br>
End If<br>
<br>
'Use this SQL statement to select the records to use<br>
rs.Open ReportSQL$, _<br>
"DSN=" & DSN$ & ";", adOpenKeyset<br>
Report.Database.SetDataSource rs<br>
<br>
CRViewer1.DisplayGroupTree = False<br>
CRViewer1.ReportSource = Report<br>
CRViewer1.ViewReport<br>
<br>
When I send it SQL statements without the 'Like' clause, it works fine, but that's not good enough. Anyone have a clue? Anyone know of a better report designer?