Printing in vb6 with Crystal Report
Good day :)
I was wondering if anyone can help me. I have problem using crystal report with dates..
I'm using ms access 2003 as my database and I can't print preview records between dates.
this is my code
Code:
crpt1.SelectionFormula = "{redeem.rdate} >=#" & DTPicker1 & "# AND {redeem.rdate} <= #" & DTPicker2 & "#)"
crpt1.Action = 1
it says error in selection formula
'
'
the remaining text doesn't appear to be part of the formula..
I can't seem to know what's wrong its been bugging me for hours :(
I'm a newbie in using crystal reports so please help me..
If their are any other suggestions I will appreciate it. thanks in advance :)
Re: Printing in vb6 with Crystal Report
Private date1 As String
Private date2 As String
date1 = Format$(DTPicker1.Value, "yyyy,mm,dd")
date2 = Format$(DTPicker2.Value, "yyyy,mm,dd")
crpt1.SelectionFormula = "{redeem.rdate} in Date (" & date1 & ") to Date (" & date2 & ")"
crpt1.Action = 1