Hi all,
I've got a report that takes two numeric parameters. These are both entered into textbox prompts set to Numbers Only = Yes.
The parameters are ?Lead Time? and ?Cover Days?. I have the following data items that use the parameters:
[Coverage Period] <- ?Cover Days?
[Days to Order] <- [Coverage Period] - ?Lead Time?
[Reorder Quantity] <- [Avg Sales] * [Coverage Period]
Now, coverage period used to be defined using a date prompt, as the difference between the selected date and today. I want to use a numerical prompt instead so the user can enter a number of days directly. That way, they can schedule the report and it will always use a coverage period of 30 days, for example, instead of requiring them to always reset the date to a month ahead.
Here's the problem: since switching the prompt ?Cover Days? to a textbox and using its value directly, I get the following error in reference to the calculation for [Reorder Quantity]: "The 'multiply' operation is invalid on the data types 'double' and 'character'." However, I am using the same type in the calculation of [Days to Order], using ?Lead Time? directly. Why does that one work? Because it's using two 'character' types?
If I try to cast ?Cover Days? into an int or numeric, so it'll work in the calculation of [Reorder Quantity], I get a different error: "A 'freeform' number is invalid." Has anyone encountered that before? I have no idea what it means.
Thanks!
Whoops. Turns out the error was actually a data issue with an unrelated field, so my post is meaningless.
Sorry all.
No post is meaningless ... ;D
I ran into this error yesterday. With Oracle (our version at least - 8) in the background, I couldn't cast directly from a string to an integer. Had to cast to float, then to integer to get around it. e.g.
CAST(CAST(Model.FieldName, FLOAT), INTEGER)