Naveed_786 25 Posting Whiz in Training

Hi dear,

I want to pass two dates from crystal report and want to get result between these two dates but it returns result only from one date here is my code any suggestion:

If TextBox1.Text = "" Or TextBox2.Text = "" Then
            MessageBox.Show("Please enter Date!", "ALI ENTERPRISES", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Exit Sub
        End If
        TextBox1.Visible = False
        TextBox2.Visible = False
        Button1.Visible = False
        Dim cryRpt As New ReportDocument
        cryRpt.Load(Application.StartupPath & "\Inst2.rpt")
        Dim crParameterFieldDefinitions As ParameterFieldDefinitions
        Dim crParameterFieldDefinition As ParameterFieldDefinition
        Dim crParameterValues As New ParameterValues
        Dim crParameterDiscreteValue As New ParameterDiscreteValue
        Dim crParameterDiscreteValue1 As New ParameterDiscreteValue
        crParameterDiscreteValue.Value = TextBox1.Text
        crParameterDiscreteValue1.Value = TextBox2.Text
        crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields()
        crParameterFieldDefinition = _
        crParameterFieldDefinitions.Item("PaymentDate")
        crParameterValues = crParameterFieldDefinition.CurrentValues

        crParameterValues.Clear()
        crParameterValues.Add(crParameterDiscreteValue)
        crParameterValues.Add(crParameterDiscreteValue1)
        crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

        Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
        Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo

        For Each tbCurrent In cryRpt.Database.Tables
            tliCurrent = tbCurrent.LogOnInfo
            With tliCurrent.ConnectionInfo
                .ServerName = Application.StartupPath & "\Payment.mdb"
                .UserID = ""
                .Password = ""
                .DatabaseName = Application.StartupPath & "\Payment.mdb"
            End With
            tbCurrent.ApplyLogOnInfo(tliCurrent)
        Next tbCurrent

        CrystalReportViewer1.ReportSource = cryRpt
        CrystalReportViewer1.Refresh()

and

{instalment.PaymentDate } = {?PaymentDate}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.