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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Ranges at run time

Status
Not open for further replies.

RogerZett

Technical User
Jan 30, 2011
1
NO
I have been working on this for longer than I care to tell anyone. I have a database with a date field that I want to select only records meeting a selected date criteria. It seems that this should work but I recieve an " error in formula" when trying to run.

Report1.SelectionFormula = "{QryXXX.Date} = " & ddate

thaks in advance for the help.

Rog
 
You have to give Crystal a string that folows Crystal Syntax, which depends on the data type for the field {QryXXX.Date}.

If this is a date field (not a datetime or datetimestring) the syntax for today is:

"{QryXXX.Date} = date(2000,9,26)"

[sig]<p>Ken Hamady<br><a href=mailto:ken@kenhamady.com>ken@kenhamady.com</a><br><a href= Reports Training by Ken Hamady</a><br>[/sig]
 
How can I then use a date variable as the selection criteria?

Thanks again [sig][/sig]
 
You have to convert the date value to text, substring out the appropriate 3 values, and then reassemble them into a string that follows the Crystal Syntax. [sig]<p>Ken Hamady<br><a href=mailto:ken@kenhamady.com>ken@kenhamady.com</a><br><a href= Reports Training by Ken Hamady</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top