susnewyork
asked on
Formula doesn't run and comes up as a blank error... simple formula
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....
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....
ASKER
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:
Time formula:
Concat formula:
-------------------------- ---------- --------
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"
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")
Time formula:
if length({@timeString}) < 11 then {@timeString} + space(length({@timeString}) - 10) else {@timeString}
Concat formula:
totext({@ClockID}+{@date}+left(totext({@ScanID}),1))+{@time}
--------------------------
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"
You are missing a )
Try this one
totext({@ClockID}) + {@date} + left(totext({@ScanID}),1)) + {@time}
mlmcc
Try this one
totext({@ClockID}) + {@date} + left(totext({@ScanID}),1))
mlmcc
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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:
Date:
Concat:
The formula runs without a problem. Thoughts?
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")
Date:
if length({@dateString}) < 11 then {@dateString} + space(10 - length({@dateString})) else {@dateString}
Concat:
totext({@ClockID}) + {@date} + left(totext({@ScanID}),1) + {@time}
The formula runs without a problem. Thoughts?
ASKER
Ah. Let me try that. The date formula has the order as you said it might have to be.
ASKER
And that was it! Thanks mlmcc.
ASKER
Also, thanks for your help too James.
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
The question can be reopened to allow you to split.
mlmcc
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
James
ASKER
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.
Is there an easy way to do that? I currently have the question marked for a moderators attention.
I could do it but since you requested their help I will let it happen that way.
mlmcc
mlmcc
Can you show the 2 formulas?
mlmcc