Results 1 to 3 of 3

Thread: [RESOLVED] Listview to crystal reports 9

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2012
    Posts
    47

    Resolved [RESOLVED] Listview to crystal reports 9

    good day! I'm now working on a project with a daily report. i managed to create some codes but i can't get it working it has an error saying "ERROR IN COMPILING SQL EXPRESSION : UNKNOWN QUERY ENGINE ERROR."

    Here is my code for the Crystal Query:

    <code>
    Dim rpt As CRAXDDRT.Report
    Dim rptApp As New CRAXDDRT.Application
    Dim date1 As String
    Dim date2 As String

    date1 = Format(DTPicker1.Value, "yyyy,mm,dd")
    date2 = Format(DTPicker2.Value, "yyyy,mm,dd")

    Set rpt = New CRAXDDRT.Report
    Set rpt = rptApp.OpenReport(App.Path & "\LogReport.rpt")

    With rpt
    .RecordSelectionFormula = "{tblLog.LogIn} in '" & DateValue(date1) & "' to '" & DateValue(date2) & "'"
    end with

    </code>

    what is wrong with it? Please give me some advice bout this. Thanks in advance..

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Listview to crystal reports 9

    Try:
    Code:
    .RecordSelectionFormula = "{tblLog.LogIn} in CDate(" & date1 & ") to CDate(" & date2 & ")"
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2012
    Posts
    47

    Re: Listview to crystal reports 9

    thanks sir! this works too!
    .RecordSelectionFormula = "{tblLog.LogIn} in '" & DateValue(date1) & "' to '" & DateValue(date2) & "'"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width