Try this:
C_Report.SelectionFormula = "{QVRpt.VisitDate} In Date(" & _
Format$(dtpFrom, "yyyy, MM, dd") & ") To Date(" & _
Format$(dtpTo, "yyyy, MM, dd") & ")"
HTH, Paul
--
Paul Little, Senior Programmer/Analyst
SVi Retail Systems
San Diego, CA
Quote:
> Hello,
> I'm a newbie in VB and Crystal reports.
> I've tried to find out solve this problem in Seagate's site but I can't
> Cleary locate
> the problem. Please advise me what did I wrong in my coding.
> (I'm running VB6 +CR7)
> I wrote like below,
> C_Report.SelectionFormula = " {QVRpt.VisitDate} >= '" & dtpFrom & "'" & "
> And " & "{QVRpt.VisitDate} <= '" & dtpTo & "' "
> "dtpFrom" and "dtpTo" are DateTime Picker in VB.
> I've got below error message.
> Run-time error '20515':
> error in formula <Record_Selection>. '{QVRpt.VisitDate} >= '2000-06-06'
And
> '{QVRpt.VisitDate} <= '2000-06-06' '
> A date-time is required here.
> Please help me out this. Thanks in advance