filter data between 2 dates in crystal report vb.net
- by irienaoki0407
I need some help for creating Crystal Reports in VB 2005.
I want to filter data between two dates (like from date and to date) with datetimepicker.
I'm using SQL Server 2000 for the connection.
Update:
Thanks for the link, but I'm trying using record selection formula....
Here's my code:
Try
Dim cryRpt As New ReportDocument
With cryRpt
.FileName = ("C:\Documents and Settings\Ratna Ayu\My Documents\Visual Studio 2005\Projects\Denda\Denda\CrystalReport1.rpt")
.RecordSelectionFormula = "{pinjam.tglkembali}>='" & DateTimePicker1.Value.ToString("dd/MM/yyyy") & "' and {pinjam.tglkembali} =<'" & DateTimePicker2.Value.ToString("dd/MM/yyyy") & "'"
End With
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
Catch ex As Exception
MsgBox("tdk ada data", , "")
End Try