Error Message

Byron Burton shared this question 27 days ago
Completed

I am using this in a Calculated field.

Cast("VW_SYS_PACKAGE"."weight" as INT) and I get this error message. (ERROR: invalid input syntax for type integer: "3.00"). What does this mean.

Replies (5)

photo
1

Hello Byron,

My name is Deepak Chaganti from the Yellowfin Technical Support Team. We have received your support request, and I will be your primary contact on the following ticket:

Ticket Number: #32298
Case Title: Syntax error message when using cast function in calc field.


The error indicates that "3.00"—the value you are attempting to convert—is not in a format that can be converted straight to an integer type.

It looks like a float value. I think that the INT (integer) type does not accept fractions or decimals; it only accepts whole values.


Request for Additional Information:

To better understand and expedite the resolution of your case, please provide me following details:

  • The info.jsp file for this instance in HTML format. In order to get this file please follow the instructions in the following link:

https://community.yellowfinbi.com/topic/how-to-get-the-info-jsp

  • A screenshot to illustrate the problem that you are facing (the entire calc field)
  • What is the data type of "VW_SYS_PACKAGE"."weight" in the db and is it a dimension in yellowfin?
  • And also the name of the data source db that you are currently using (For example: SQL server, Mysql etc)


Sincerely,

Deepak Chaganti

Yellowfin Technical Support Engineer

photo
1

Can CAST or CONVERT BE USED in a calculated field in Freehand SQL? If either can be used like this please provide the syntax. The field name is ("VW_SYS_CASE"."case_number")), "VW_SYS_PACKAGE"."weight")

Something like this but this gives an error message even though the builder says it is valid?

CAST("VW_SYS_PACKAGE"."weight" AS DECIMAL(10, 2))


I also tried using the Advanced Function / Data Conversion / Text to Numeric but that did not work either.

photo
1

Hi Byron,

Could you please share the following details:

1. The data type of "VW_SYS_PACKAGE"."weight" in both database and also in YF.

2. If you can also let me know the db you are using (Example: SQL server, Mysql etc) I will try to create a datasource on same db with a field similar to "VW_SYS_PACKAGE"."weight".

3. info.jsp of the environment.

Usually we would perform the conversions at view level but not in calc field:

1ae52af6a1ad45e06c4001d5103d7664


I have tried converting a simple numeric to varchar in freehand sql and it seems to be working:

69a60a3749f554c5406397c0689c50bd


Thanks,

Deepak

photo
1

Great this works. thanks again. You can close this request


CAST("VW_SYS_PACKAGE"."weight" as VARCHAR(10))
e5dcae4ae9320ce0dd62eeb2cc74bd29
photo
1

Hi Byron,

Thanks for letting me know.

I am glad that I was able to assist. I will now mark this as completed.

Regards,

Deepak

Leave a Comment
 
Attach a file