Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

Error 20515

Hi everyone,

I am using CR8.0. In my report I have only one formula (all the others have been commented. They generate the same error on diff Formulas).
When I launch a .bat file (see command below) which execute a VB6 app which receive 1 parameter for CR (that part works fine), I get the following error message:
20515 - Error in Formula <Formula_Field>.
'StringVar str;
'
The ) is missing.

Here is the code for the Formula. There are no ) missing ???
StringVar str;
str := "Du ";
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")));
str := str + " au ";
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")) + 6);
str

Note: Timestamp is a DateTime.
The VB6 app is exporting from .rpt to .xls. This works fine without the Formula mentionned above.
the .bat command is:
MyVB6App.exe "username||pwd||MyRPTReportPath||MyXLSReportPath||19||TheParameterForCR"

username and password for the database
.rpt report source and the destination .xls report
19 is the format of exportation (.xls) and
the parameter for CR Report.

I cannot see where is the real problem.
HELP please !!!

Thanks a million
Gallia


0
Gallia
Asked:
Gallia
  • 8
  • 7
1 Solution
 
mlmccCommented:

GroupName takes only 1 parameter

str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")));

should be

str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}), "daily"));


str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}), "daily") + 6);

mlmcc
0
 
GalliaAuthor Commented:
mimcc,

The second DateValue (case with + 6) you suggested is giving this error:
To many argument for DateValue (which takes 1 or YYYY,MM,DD)

but if instead I put:
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp})+6), "daily");
The msg is A string is expected (+ "6"). But I want to add 6 days, not append 6 to the date. How can i do it ?

Thanks again
Gallia
0
 
GalliaAuthor Commented:
mimcc,

I forgot to add that even if i put the second str := ... in comment, i still get the error 20515 The ) is missing.

Gallia
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
GalliaAuthor Commented:
mimcc,

I forgot to add that even if i put the second str := ... in comment, i still get the error 20515 The ) is missing.

Gallia
0
 
GalliaAuthor Commented:
mimcc,

I forgot to add that even if i put the second str := ... in comment, i still get the error 20515 The ) is missing.

Gallia
0
 
mlmccCommented:
I am not sure what the problem is.

Does

str := "Du ";
str := str + " au ";
str

work?

CR7 doesn't have the GroupName function.  I'll look at that in the morning.

mlmcc
0
 
GalliaAuthor Commented:
mlmcc,

str := "Du ";
str := str + " au ";
str

does work.
Gallia
0
 
mlmccCommented:
You need a format string in the ToText function


StringVar str;
str := "Du ";
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")),"dd-MMM-yyyy");
str := str + " au ";
str := str + ToText(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")) + 6","dd-MMM-yyyy");
str


mlmcc
0
 
GalliaAuthor Commented:
mlmcc,

I removed the double quote after the 6, it gave the ) missing error in CR.
Now CR doesn't give any error, but when I execute the .bat file, I still get the error 'The ) is missing'.

What could be the reason(s) ?
Thanks
Gallia

0
 
mlmccCommented:
It has something to do with the adding of 6
Delete that line and see if it is accepted.

There is a date add function in CR8. (DateAdd I think)

Not sure of the syntax
It is either
DateAdd(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily"))), 6 ,"D")

or

DateAdd("D",DateValue(GroupName ({iApplicationStat.Timestamp}, "daily"))), 6 )

mlmcc
0
 
GalliaAuthor Commented:
Sorry for the delay.

I have tried what you suggested and all the variations possible, but nothing worked. When i try

DateAdd(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")), 6 ,"D")

I get 'a string is expected here. (before DateValue)

if i try
DateAdd("D",6,DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")))

I get the error 'missing )'

Thanks for your help and your time
Gallia
0
 
mlmccCommented:
You still need the ToText( )around the date

Sorry.  Was lazy in typing and copying.

mlmcc
0
 
mlmccCommented:
ToText(DateAdd(DateValue(GroupName ({iApplicationStat.Timestamp}, "daily")), 6 ,"D"))

mlmcc
0
 
GalliaAuthor Commented:
mlmcc,
Your last comment did not work either. I am considering to get rid of the GroupName function. It doesn't seem to be mandatory.

The working code is:
ToText(DateAdd("D",6,DateValue({iApplicationStat.Timestamp})));

Thanks for the help
Gallia
0
 
mlmccCommented:
I see where the problem lies then.  Forgot the format of the DateAdd

ToText(DateAdd("D",6,DateValue(GroupName ({iApplicationStat.Timestamp}, "daily"))))

Glad you got it solved.

mlmcc
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now