Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Formula doesn't run and comes up as a blank error... simple formula

Posted on 2013-06-17
14
Medium Priority
?
233 Views
Last Modified: 2013-06-19
Hi,

I have a formula that converts a datetime to a time with the format of HH:mm:ss. That formula by itself works fine. The value is converted from time to string. It's names Time.

I then add that formula to another formula (named Concat) that concatenates multiple string values together. This formula will stop the report from running if I add the Time formula to it. There is no error produced; the Time formula within the Concat formula is highlighted and the report will not continue.

The formula will pop up and highligh Time and not mention any real issue. When I check the code, there are no errors....
0
Comment
Question by:susnewyork
  • 6
  • 5
  • 2
14 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 39253672
Can you have NULL values?

Can you show the 2 formulas?

mlmcc
0
 
LVL 1

Author Comment

by:susnewyork
ID: 39253701
I forgot to mention the third formula. To be clear:

TimeString: Takes the dateTime field and changes it to a text time format.

Time: Takes TimeString and adds spaces to the end of the string as needed by my company.

Concat: Takes all needed fields and adds them to a text string.

------------------------------------------------------------

TimeString:
totext(time({TAData.DateTime}), "HH:mm:ss")

Open in new window


Time formula:
if length({@timeString}) < 11 then {@timeString} + space(length({@timeString}) - 10) else {@timeString}

Open in new window


Concat formula:
totext({@ClockID}+{@date}+left(totext({@ScanID}),1))+{@time}

Open in new window



--------------------------------------------
I just noticed that when I change the concat formula to exclude the Time formula, the following error appears for the Time formula:

"The number of copies of the string is too large or not an integer"
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39253721
You are missing a )

Try this one

totext({@ClockID}) + {@date} + left(totext({@ScanID}),1)) + {@time}

mlmcc
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
LVL 35

Assisted Solution

by:James0628
James0628 earned 1000 total points
ID: 39255689
Your @Time, or possibly @TimeString, formula is wrong.

 @Time checks for length < 11, but the "HH:mm:ss" format is only 8 characters.  In fact, it will always be exactly 8, because "HH", "mm" and "ss" include leading zeroes.  So the length will always be < 11.

 The problem is that you then use Space (Length ({@timeString}) - 10), which gives you Space (8 - 10), or Space (-2), and that's invalid (you can't have a negative number of spaces).

 So, the question is, what are you trying to do with that < 11 check?

 James
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 1000 total points
ID: 39256241
You probably really want to reverse the subtraction.  I suspect you are trying to add spaces to make sure there are 11 characters being added.

 Space (11 - Length ({@timeString}) )

mlmcc
0
 
LVL 1

Author Comment

by:susnewyork
ID: 39256249
Hi James,

I have a similar formula that does the same thing with date. The date doesn't produce an error. The formulas for the date set:

DateString:
totext(date({TAData.DateTime}), "MM/dd/yyyy")

Open in new window


Date:
if length({@dateString}) < 11 then {@dateString} + space(10 - length({@dateString})) else {@dateString}

Open in new window


Concat:
totext({@ClockID}) + {@date} + left(totext({@ScanID}),1) + {@time} 

Open in new window


The formula runs without a problem. Thoughts?
0
 
LVL 1

Author Comment

by:susnewyork
ID: 39256258
Ah. Let me try that. The date formula has the order as you said it might have to be.
0
 
LVL 1

Author Comment

by:susnewyork
ID: 39256261
And that was it! Thanks mlmcc.
0
 
LVL 1

Author Comment

by:susnewyork
ID: 39256267
Also, thanks for your help too James.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39256284
You could have split the points with James.  His comment really pointed out the error or problem.

The question can be reopened to allow you to split.

mlmcc
0
 
LVL 35

Expert Comment

by:James0628
ID: 39256769
Good catch on the solution mlmcc.  It seems obvious now that you've pointed it out, but for some reason it just didn't click here.

 James
0
 
LVL 1

Author Comment

by:susnewyork
ID: 39256783
I'm trying to reopen the question to reassign points. Mlmcc is right.

Is there an easy way to do that? I currently have the question marked for a moderators attention.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39256866
I could do it but since you requested their help I will let it happen that way.

mlmcc
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question