how to select the records between two date ranges in selection formula in crystal report.i am beginner to crystal report.if anybody have
idea about this on pls forward ur result to my id

if ur using access backend:

dtpFrom and dtpTo are time controls being used on vb6 frontend

'format date values as MM/dd/yyyy
Dim DtFrom as String, DtTo as String
DtFrom = dtpFrom.Month & "/" & dtpFrom.Day & "/" & dtpFrom.Year
DtTo = dtpTo.Month & "/" & dtpTo.Day & "/" & dtpTo.Year

crptAttnRpt.ReportFileName = App.Path & "\Report\rptAttendance.rpt"
crptAttnRpt.SelectionFormula = "{tblAttendanceLog.AttndDate} >= #" & DtFrom & "# and {tblAttendanceLog.AttndDate} <= #" & DtTo & "#"
crptAttnRpt.Action = 1
crptAttnRpt.Destination = crptToWindow

or else use single quotes instead of # (if backend is not access)

Be a part of the DaniWeb community

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