Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Range

Status
Not open for further replies.

keenanbr

Programmer
Oct 3, 2001
469
IE
What is the syntax for using a date range in the RecordSelectionFormula property.

Regards,

Brian
 
You just use an = sign with the datrange, i.e

{Date Field} = {?Date Range}

Is that what you mean??




-Steve


"if at first you don't succeed, sky diving is not for you"!!! :eek:)
 
But it required the date in a particular format and I can't remember it
 
How do you mean?? do you mean its asking for a date as mm/dd/yyyy or yyyy/mm/dd or dd/mm/yyyy???

You do need to explain things a bit better because syntax is the code in crystal, this is a date format issue.

Not having a go it just makes things easier for both parts.



-Steve


"if at first you don't succeed, sky diving is not for you"!!! :eek:)
 
if you put the date in the RecordSecectionFormula property in VB in the format suggested Crystal interprets it as a number and takes the / as a divisor and attempts to devide the numbers. I can't remember the correct syntax.
 
I have had much better coding and easier reports by doing the following.

Instead of passing the recordselectionformula I simply insert the begDate and endDate as parameters in the report. (not using a range and insure that both parameters of of type DATE.

Write the record selection into crystal using the IN({?begDate} to {?endDate}) as part of the selection criteria.

In vb pass the parameters as follows.

.ParameterFields(1).AddCurrentValue (CDate(Format(frmReports.txtLogBegDt.Text, "MM/DD/YYYY")))
.ParameterFields(2).AddCurrentValue (CDate(Format(frmReports.txtLogEndDt.Text, "MM/DD/YYYY")))

This gets past the recordselectionformula having to have the Date(YYYY,MM,DD) built into it.




Andy Baldwin

"Testing is the most overlooked programming language on the books!
 
what i was looking for was

Report.RecordSelectionFormula = "{DatabaseTable.DateField} = DATE(" & Format(Mydate, "YYYY,MM,DD") & ")"

This works fine.


I will try using parameters just to see how they work when i get a chance.

Regards,
Brian
 
Hello there,

Where do I get the Pdssql.dll in order to register it to a machine. Can someone email it to me. I have seached my machine but can't find it but reports runs okay. In another machine it says pdssl.dll is missing. Where do I get it from?
Joel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top