Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-06-17
14
Medium Priority
?
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

715 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