
How to print records between two dates with CR6 and VB6
Marius,
This seems to be a common plight. If I remember correctly, when I was using
CR 4.6 that came bundled with VB...
Oh, yes, when you are in the design environment of CR, you have to select
how you want the dates to be handled, ie: DATE/TIME, STRING, etc., but if
I'm not mistaken, either way you had to treat the dates in your select
criteria as strings and you had to format them like CR uses.
Dim datOne as Date, datTwo as Date
datOne = Format(YourDateVariable, "yyyy/mm/dd")
datTwo = Format(YourOtherDateVariable, "yyyy/mm/dd")
With CR1 'the CR ActiveX control
.SelectionFormula = "{Table.Date} >= ' " & datOne & _
" ' AND {Table.Date} <=' " & datTwo & " ' "
.Action = 1
End with
Try something like that. The problem is how CR formats it's dates. Also, I
think it has something to do with CR syntax being Xbased (ie: Clipper,
FoxPro, Dbase)
If this doesn't do the trick email and I'll dig out some code for you.
Hope it Helps,
Lee