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!

Error in formula!!!! 1

Status
Not open for further replies.

Alira

Programmer
Mar 21, 2001
77
CA
Hi all!

I don't get it...
For another report it works perfectly...
What could be the problem?

Dfrom = Format(Dfrom, ("yyyy,mm,dd"))
Dto = Format(Dto, ("yyyy,mm,dd"))

repC.SelectionFormula = "{Module_time.Ship Date} in Date (" & Dfrom & ") to Date (" & Dto & ")"

The name of the field is not misspelled and in the intermediate window I have:

{Module_time.Ship Date} in Date (2001,01,01) to Date (2001,07,01)

Please, give me a ahnd with that...
 
Hi Alira-
What error message is it returning and when? -rodbac
 
Run-time error #20515

Error in formula


stops at - - repC.Action = 1
 
Is this a Date field?

If you open the report in the report designer and past in your formula does it accept it there? If not it will give you a better message. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
In report designer it would give error a ')' is missing. Apperently double quotes in format funcrion were not accepted. When I corrected it it gave me error "Not enough arguments have been given to this function" on Date function.
What I have to do?
 
Cut and paste the complete selection formula that you are testing from your report to here. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
here it is:

{Module_time.Ship Date} in Date(" & Format(Dfrom, 'yyyy,mm,dd') & ") to Date(" & Format(Dto, 'yyyy,mm,dd') & ")
 
This is not a valid CR formula, this is a VB formula. I want the formula you are using while in the report designer. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
well, I don't know how to modify it.. for designer...
Can I use Format there?Can I use variables? I don't have have Help files to answer those questions...
 
I tried this:
{Module_time.Ship Date} in Date (2001,01,01) to Date (2001,07,01)
telling me that string is required with cursor just before Date.
 
BINGO! That was what I was looking for.
Your Date field isn't a date, it is a string. You can't compare date values to string values in CR. You can convert the string field to a date, or if it is in a format that sorts correctly, you could give it two date strings for comparison. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Thanks a lot!!!
I forgot to check "Convert date\time values to date" for this report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top