| johnyager@yahoo.com 2005-05-25, 8:58 pm |
| Hi all,
I'm having difficulty figuring out how to pass a date range to the
RecordSelectionFormula so that only records received within those dates
will appear on the report.
I've tried several things that I've found on the web, but so far none
have worked. I went into the Crystal Reports program and created a
quick and dirty report. I used the Selection Expert to define a date
range and it gave me the following formula:
{EE_RQST.EE_RQST_RCV_DT} in DateTime (2005, 05, 01, 00, 00, 00) to
DateTime (2005, 05, 15, 00, 00, 00)
which worked fine on that report. But when I copied that string over
to VB6 and ran the report, nothing was printed.
I've tried various other strings like
"{EE_RQST.EE_RQST_RCV_DT} in #5/1/2005# to #5/15/2005#" and
"{EE_RQST.EE_RQST_RCV_DT} in DATETIME(" & Format(dateStart,
"yyyy,mm,dd,hh,mm,ss") & ") to datetime(" & Format(dateFinish,
"yyyy,mm,dd,hh,mm,ss") & ")""
but none have worked. I'm at my wits end here. Also, the report
prints fine when I don't specify the RecordSelectionFormula, so I'm
sure the problem stems from that.
The receive date on the SQL Server table is defined as "datetime" .
Any suggestions as to how to get this working?
Thanks.
|