I had someone tell me about this (value.date) thing so I tried it and it worked.
selectFormula = "{Ticket.Flight_date} >= #" & monthPicker.Value.Date & "# And {Ticket.Flight_date} <= #" & monthPicker2.Value.Date & "# And {Customer.Customer_ID} = " & cboCustomerSSN.Text & " "
I am going to try your code tomorrow.
I want to see if the month is any different than the date.
Thanks;)
Dim frmCustomerSummary As New frmCustomerSummary()
frmCustomerSummary.Show()
Dim report As New ReportDocument()
Dim selectFormula As String
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Try
report.Load("..\CrystalReport_customer_month.rpt")
For Each tbCurrent In report.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = "someservername"
.UserID = "someuserid"
.Password = "somepassword"
.DatabaseName = "somedatabasename"
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
selectFormula = "{Ticket.Flight_date} >= #" & monthPicker.Value.Date & "# And {Ticket.Flight_date} <= #" & monthPicker2.Value.Date & "# And {Customer.Customer_ID} = " & cboCustomerSSN.Text & " "
report.DataDefinition.RecordSelectionFormula = selectFormula
frmCustomerSummary.CrystalReportViewer1.ReportSource = report
frmCustomerSummary.CrystalReportViewer1.Zoom(100)
Catch Exp As LoadSaveReportException
MsgBox("Crystal Reports has failed to load please try again.", MsgBoxStyle.Critical, "ERROR")
Catch Exp As Exception
MsgBox(exp.Message, MsgBoxStyle.Critical, "ERROR")
End Try