Crystal Reports Newbie needs help 
Author Message
 Crystal Reports Newbie needs help

I'm working on a report where the SQL string's values are determined
at runtime, based on user choices (code is below).  In the de{*filter*}, I
added watches for strSQL, startDate, endDate and those values are
getting set the way I expect them to.  However, the report is
displaying all of the records in my table.  I believe I have to set
something up in the report to handle the SQL string but I have no idea
where to do this.  Could  someone please tell me how to do this?  I'd
greatly appreciate someone's help.  Thanks in advance.

    Dim strSQL As String
    Data1.DatabaseName = App.Path & "\Development Log.mdb"
    Data1.RecordsetType = 1

    startDate = DTStart.Value
    endDate = DTEnd.Value

    strSQL = "SELECT * "
    strSQL = strSQL & "FROM LogComments "
    strSQL = strSQL & "WHERE LogComments.[Work Date] >= " & startDate
    strSQL = strSQL & " And LogComments.[Work Date] <= " & endDate
    CrystalReport1.SQLQuery = strSQL
    'Opening the report in preview mode
    CrystalReport1.Action = 0

Molly J. Fagan

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 Crystal Reports Newbie needs help
I do it a slightly different way.  Your SQL statement looks ok but I would
create a temporary table based on the sql and then use the table to run a
very simple report from CR

regards

Chris

Quote:

> I'm working on a report where the SQL string's values are determined
> at runtime, based on user choices (code is below).  In the de{*filter*}, I
> added watches for strSQL, startDate, endDate and those values are
> getting set the way I expect them to.  However, the report is
> displaying all of the records in my table.  I believe I have to set
> something up in the report to handle the SQL string but I have no idea
> where to do this.  Could  someone please tell me how to do this?  I'd
> greatly appreciate someone's help.  Thanks in advance.

>     Dim strSQL As String
>     Data1.DatabaseName = App.Path & "\Development Log.mdb"
>     Data1.RecordsetType = 1

>     startDate = DTStart.Value
>     endDate = DTEnd.Value

>     strSQL = "SELECT * "
>     strSQL = strSQL & "FROM LogComments "
>     strSQL = strSQL & "WHERE LogComments.[Work Date] >= " & startDate
>     strSQL = strSQL & " And LogComments.[Work Date] <= " & endDate
>     CrystalReport1.SQLQuery = strSQL
>     'Opening the report in preview mode
>     CrystalReport1.Action = 0

> Molly J. Fagan

> Sent via Deja.com http://www.*-*-*.com/
> Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Please Help Newbie Crystal Report / VB help needed.

2. Newbie needs help with Crystal Reports parameters

3. Newbie needs help with crystal report

4. Newbie needs help with Crystal report

5. CRYSTAL REPORT HELP NEEDED FOR NEWBIE

6. Help needed for Crystal Reports 8 newbie!

7. Need Report to look at SQL Data source ( VB / CR newbie needs help)

8. Printing Crystal Reports report help needed

9. Need help printing LARGE reports with vb3.0 and Crystal Reports

10. Need help to write a report with Crystal Report

11. Need help printing LARGE reports with VB3.0 and Crystal Reports 4.5

12. Please Please help !!! Crystal Report Help Needed

 

 
Powered by phpBB® Forum Software