For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > May 2005 > Passing date range to RecordSelectionFormula









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Passing date range to RecordSelectionFormula
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.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com