How to print records between two dates with CR6 and VB6 
Author Message
 How to print records between two dates with CR6 and VB6

I'd like to know how it is possible to have a report with all the records
included in a period of two date with VB6. I know that with
"selectionformula" it is possible to "filter" the records but I tried many
time with different  selections without any positive result.

Marius



Fri, 09 Aug 2002 03:00:00 GMT  
 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



Sun, 11 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Printing a Date in CR6.0

2. Problem reporting range of dates with CR6 and VB6

3. finding a range of dates using CR6 with VB6

4. CR6 + VB6 Printing at dot matrix printers

5. Weird printing problem using CR6 and VB6

6. Problem printing report using CR6 with VB6 SP3

7. How to query all record between two date?

8. HELP COUNT records between two dates!!!!

9. SQL: records by years between two date

10. Need help with Select statement syntax to retrieve Access2000 record between two dates

11. Need help with Select statement syntax to retrieve Access2000 record between two dates

12. How to calculate the difference between two dates (time elapsed between two program starts)

 

 
Powered by phpBB® Forum Software