Data type of Crystal syntax formula

Post Author: gpeters
CA Forum: General
How do you control the data type a Crystal formula returns?  I'm relatively new to Crystal.  I'm developing a formula, and initially I'm having it return Boolean values.  However, my intent is to have it eventually return a string value.  Now, it seems that no matter what I do, this formula is determined to only return a Boolean value.  Should I have used Basic syntex instead?  Very frustrating to be fighting syntax stuff.

Post Author: CoolTowers
CA Forum: General
Generally strings are used with text such as address blocks, names, etc. Crystal interprets anything in quote marks as a string; then you just add them together.
You can try the ToText function to convert other data types to a string data. For example:
"Thanks for purchasing" + ToText({lastyear.sales}) + "in parts last year".  
Look under the Function Tree box under Strings, then ToText for ways to use the function.

Similar Messages

  • Return data type in Crystal syntax formula

    Post Author: gpeters
    CA Forum: Formula
    How do you control the data type a Crystal formula returns?  I'm relatively new to Crystal.  I'm developing a formula, and initially I'm having it return Boolean values.  However, my intent is to have it eventually return a string value.  Now, it seems that no matter what I do, this formula is determined to only return a Boolean value.  Should I have used Basic syntex instead?  Very frustrating to be fighting syntax stuff. 

    Post Author: SKodidine
    CA Forum: Formula
    If you could copy your formula here then it would paint a better picture to help you out.  In general, you can change the data type to string (totext) and also to number (tonumber) in a formula.  It all depends on what you are trying to accomplish.

  • What is the data type of the value returned by the List box prompt in crystal

    Post Author: Mudit Kothiyal
    CA Forum: Formula
    Hi all,
    I am creating a report which has a list box prompt. When I am selecting a single value from the list box the report is working fine, but when I am selecting multiple values its not returning any data( although data is there). Does anyone know how the prompt values are passed to the report query by the crystal. I kno it passes the value to the report as an array. But how does it pass the value to the report query.
    I am using command query to fetch data from the DB.
    Crystal Report Version: Crystal Report XI R2.
    DB: Oracle 10g
    Also does anyone know how to pass the values of the list box prompt to the report query in comma seperated format.
    Thanks & regards,
    Mudit

    Post Author: rcoleman
    CA Forum: Formula
    In regards to the latter part of your question
    The following examples are applicable to Basic and Crystal syntax.
    The examples assume that list is a String array consisting of the 3 elements: "Chocolate", "Vanilla" and "Strawberry".
    Join (list)
    Returns the String "Chocolate Vanilla Strawberry".
    Join (list, "***")
    Returns the String "Chocolate**Vanilla**Strawberry".
    Not sure about the first part of your question,sorry.

  • Crystal reports converting varchar 254 to memo data type

    Hi All,
    We are still using Seagate Crystal Reports 7.5 for some of our reporting. I have a problem that hopefully someone can help with. One of our connections is to ODBC- AR System ODBC Data Source.
    In that data source there are fields defined as varchar 254 (confirmed by DBA),
    But Seagate is calling them memo fields- which is causing problems since you canu2019t use memos in selection criteria or formulas.
    This happened after the field names were renamed. I noticed when the newly named fields were not showing as an option to map the old name fields to- because by default it looks for same data type, after unchecking same data type option the fields showed for mapping but wrong data type makes them useless. I canu2019t even convert them to string with formula field.
    Any input would be greatly appreciated.
    Thanks-

    Hi,
    Yup, this was a problem with versions prior to 10.  If a field was longer than 254 characters, Crystal handled them like Memos and you cannot use them in formulas.
    The only suggestion I can offer would be to upgrade.  Crystal can now use memos in formulas and no longer has a 254 character limit on strings.  So your charcter fields will remain as charater and not changed to Memos.
    Good luck,
    Brian

  • Diffrent Data Type & Formula in Cross Tab

    Post Author: ade
    CA Forum: General
    I using crystal reports 8.5. I make cross tab like this to viewing reportsSubject           Evaluation Aspect                          Score1        Score2            Score3        Score4        Score5 Math               Conceptual Understanding                     80                    75                     70                 80                   A                          Problem Solving                                          77                    80                            90                67                    BEnglish                Reading                                                        89                    80                             86                80                    A                                Wring                                                        80                        80                              70                85                  Bfrom the table above, there are 2 types of different data they are numeric and string.In the using of logical "if" in cross tab is not allowed to use different data type and I don't understand on it... would you please help me, what shoul I do then? 

    Yes it is possible.
    It would be easier in CR2008  where you have the ability to add Calculated Members.
    In previous versions you would need to create a variable for each year and using the GridRowColumnValue function assign the current value to a variable. You would then need to add a second summary field as a "dummy" summary and in the Display string formula declare the variables and manipulate the values as you like and finally convert the output to string.

  • How to have a member formula to reference a text data type member?

    Hi there
    I am just wondering how do you use a member formula to grab the text in a text data type member?
    Our situation is that we have a text data type member in the Accounts dimension (called Project Manager). This is a free text field users can input a project manager's name. However, for our reporting purposes we want to report the Project Manager next to a list of Accounts (i.e. in the same row). The way we have tried to achieve this is to create dynamic calc text data type members in the Version dimension that simply refer to the Project Manager account using the reference function (->).
    Although this works, when we run a report we get a number (assuming this is just the reference ID to the RDBMS field) instead of the actual name. We have set the dynamic calc member to text data type as well. We are using a planning connection as well.
    Does anyone know how to make this work?
    Thanks

    Are you talking about FR reports, does it display the text if you reference the original member using a planning connection, if it does then it probably looks like you can't do it using the method you are trying as it is an essbase formula and in theory it will just return a number.
    Cheers
    John
    http://john-goodwin.blogspot.com

  • Crystal Data Conversion Issue (Error converting data type varchar to datetime)

    Hi,
    I can run stored procedure without error in SQL Server using my personal credentials as well as database credentials.
    I can also run Crystal Report after connecting to Stored procedure without error on my desktop using my personal credentials as well as database credentials.
    But when I upload the crystal report in BOBJDEV and when I run using database credentials report fails saying that "Error in File ~tmp1d1480b8e70fd90.rpt: Unable to connect: incorrect log on parameters. Details: [Database Vendor Code: 18456 ]" but I can run the crystal report successfully on BOBJDEV using my personal credentials.
    I googled (Data Conversion Error Message) about this issue & lot of people asked to do "Verify Database" in Crystal Report. So I did that, but when I do it I am getting a error message like this:
    Error converting data type varchar to datetime.
    Where do you think the error might be occurring? Did anyone faced this kind of issue before? If so, how to resolve it?
    (FYI, I am using Crystal Reports 2008, & for stored procedure I have used SSMS 2012 )
    Please help me with this issue.
    Thanks & Regards.
    Naveen.

    hello Naveen,
    since the report works fine in the cr designer / desktop, we need to figure out where you should post this question.
    by bobjdev do you mean businessobjects enterprise or crystal reports server? if so please post this question to the bi platform space.
    -jamie

  • How can i add formula to waveform data type?

    I want to interpolate my acquired data in terms of voltage to temperature. For this i need to use polynomial equation, but i am not able to directly attach formula node to the waveform data type. I want to know how can i add formula node to waveform data, and then also have it real time.

    One additional thought that may be helpful. Once you get the Y component of the waveform graph you are going to attempt to wire this into a formula node. You can do one of two things with that array. Put a for loop around the formula node and index the array into and out of the for loop. This allows you to do scalar math on the data. It is also possible to index and array in a formula node. The following KnoledgeBase demonstrates how to do this: http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/9d72b6069346942386256a0d00604ed4?OpenDocument

  • Data Type syntax colour

    Why can't Flex hilight data types?
    Like in:
    var foo:String = "bar";
    String won't colorize.
    Is this possible to set somewhere (not in the syntax color preferences)?

    checking with different options, found that the issue was related to "ORA-01727: numeric precision specifier is out of range (1 to 38)".
    We change the Column numeric length to 8 and this solved the problem.
    Thanks for your suggestions.

  • Optional Prompt for Date type parameter in Crystal Report.

    Hi Every One,
    I have a date type parameter in crystal report.When I am convert it to optional prompt it is showing following message.
    But the Type field is gray out when I was selecting list of values Dynamic.
    Please suggest.
    Thanks and Regards
    DEV

    Hi,
    Please check SAP note:
    1710595 - CR_Defining "Optional Prompt" as True for SAP Crystal
    Reports Does Not Work
    Thanks & Regards,
    Nagarajan

  • ABAP in SapScript : syntax, data types, ... ?

    Hello,
    Can someone tell me what are the biggest differences between regular ABAP and ABAP in SapScript? Like syntax rules, possible data types, and so on.
    Thanks!

    Ok, thanks for the answers.
    Just one more question
    Is it then also possible to create a SmartForm form (or Adobe Form) from within SapScript? I am looking for a workaround solution for correspondence in Training and Event Management. Only SapScript forms are possible, but if it is possible to create other forms with ABAP code in the SapScript, it could work, I think?

  • Crystal Syntax "Like" Statment on date searches.

    Post Author: smilbuta
    CA Forum: Data Connectivity and SQL
    Hello,
    I am currently developing an application using VS2005 and Crystal Reports.
    I wish to pass a Crystal Syntax statement to the report that searches for like dates in a date column in a SQL 2005 Database..
    The statments as follows.
    crystalsyntax = "{EQ_Equipment.equipment_warranty} like '2009'"
    I get returned an error saying string expected??
    so i tested diferent formats, and if i use this string i get only one record returned out of a known test group of 10 records.
    "{EQ_Equipment.equipment_warranty} Like DateValue('2009')"
    so im unsure what im doing wrong. Any advice would be apreciated.

    Post Author: Jagan
    CA Forum: Data Connectivity and SQL
    LIKE is used to compare strings. You're trying to compare a date with a string. That's why it says "string expected".
    I'm not sure what the result of DateValue('2009') is, but it's pretty certain that what you've then got is a date (warrenty) being 'liked' with a date, so both are being implicitely converted to strings first.
    What you could do is explicitely convert the warrenty date to a string in a format of your choice (don't rely on the implicit format) and then LIKE that with '2009'.
    Or change your statement to Year() = 2009  but this might result in Crystal doing the hard work instead of the database.
    Best would be to test that the warrenty date is in the year range, so that you can still use any index that might exist on the warrenty date column. See the help on 'in range operator'. e.g.  in DateValue(<year>, 01, 01) to DateValue(<year>, 12, 31)

  • Error in converting character string to smalldatetime data type

    I've installed SQL Server 2000 on my new laptop and Crystal Report XI, out of sudden, the Crystal Report to certain view can't run and I got the following error:
    Details: 22007 [Microsoft][ODBC SQL Server Driver][SQL SERVER]Syntax Error cnverting character string to smalldatetime data type.
    Any suggestions?
    Hannah

    Here is the view the err is complaining about:
    SELECT     TOP 100 PERCENT Cur.Closed_Month, Cur.Closed_Year, Cur.Incidents_Closed, Prev.Incidents_Closed AS PrevIncidents_Closed,
                          YrAgo.Incidents_Closed AS YearIncidents_Closed
    FROM         (SELECT     Closed_Month, Closed_Year, Incidents_Closed
                           FROM          dbo.Incidents_Closed) Cur INNER JOIN
                              (SELECT     Month(CONVERT(datetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 32) AS PrevMonth,
                                                       year(CONVERT(datetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 32) AS PrevYear,
                                                       Incidents_Closed
                                FROM          dbo.Incidents_Closed) Prev ON Cur.Closed_Month = Prev.PrevMonth AND Cur.Closed_Year = Prev.PrevYear INNER JOIN
                              (SELECT     Month(CONVERT(smalldatetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 366) AS PrevMonth,
                                                       year(CONVERT(smalldatetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 366) AS PrevYear,
                                                       Incidents_Closed
                                FROM          dbo.Incidents_Closed) YrAgo ON Cur.Closed_Month = YrAgo.PrevMonth AND Cur.Closed_Year = YrAgo.PrevYear
    What confused me is that it works fine with my previous laptop. I wonder if there is any patch in Crystal Report or SQL server that used to support certain functions but not support them anymore....
    Thanks
    Hannah

  • Converting VARCHAR2 to a DATE type-then need month spelled out

    I have a field that should be a DATE type, but is instead a VARCHAR2(8). The data in the VARCHAR2(8) field is displayed as what looks like a date -- EX: 09/18/09. I need to be able to convert the VARCHAR2(8) field so that it brings back the spelled out month plus the numeric day and year -- EX: September 18, 2009.
    I've been able to successfully convert a DATE type to the needed format (September 18, 2009) using the following syntax line, but now need to convert the VARCHAR2(8):
    to_char(jud_report_hear_off_v.incdate,'fmMonth dd, yyyy,') as INCDATE
    Your help is appreciated!!!

    So here is what worked.  I added this syntax line to my COMMAND in Crystal Reports:
           to_date(jud_report_hear_off_v.INCDATE, 'MM/DD/YYYY') as "INCDATE",
    Once that line was added into the COMMAND, the new format type was now a DATE and no longer a STRING (VARCHAR2).  I added INCDATE into my report and the date appeared as 09/19/2009, as it did before, but I could now select the INCDATE field via the Format Editor and see the option to select a desired Date and Time format.  I could then change the format to the choice of spelling out the month (EX:  September 19, 2009).
    Hope this helps others!  Whew!

  • Time Data Type when Exporting to Excel

    Hello,
    I have a report I wrote using crystal reports XI. There is a datetime field which I converted to a time field through the use of a formula and the time function.  When I right click on the field and view the data type it says time.
    However, when I export to excel the field comes up as a custom field.  How do I get it so that the exported field will appear as a time field in excel?
    Thank you for your help.

    >
    Vitaly Izmaylov wrote:
    > As far as I know, Crystal Reports does not export field type - only data.
    >
    > MS Excel defines the type by reviewing first top records and there is a knowledge base article on Microsoft website on this subject.
    >
    > Could you please give us an example how your time fields look like in Crystal Reports?
    The time looks like this:
    21:38
    10:53
    00:14
    Thanks,
    Athalia

Maybe you are looking for

  • How do I save emails with original dates to a cd

    I am trying to save a sizable group of emails to a CD and have tried to create a folder and simply drag and drop each one.  This is both time comsuming and it leaves me with all the dates reflecting today instead of the original email dates.  Is ther

  • Disconnecting Internet

    Hi, I play a game called Enemy Territory on PC, but whenever I join a server to play, my whole internet disconnect. I have a BT Home Hub 1.0 and a 1MB internet speed. It also happens when I log on to Xfire, My whole internet disconnects and my home h

  • Will windows os under parallels migrate to new mac using migration assistant

    I have been using parallels 7 with windows 7 on a 2008 macbook pro. I have gotten a new 2012 macbook pro and plan to use migration assistant. Will windows install without my having to call Microsoft? I also have Office 2010 and wonder if I need to ca

  • How to transport deletion config entry

    Hi I have deleted payment terms in Development client and want to reflect the same in Quality.It did not ask for Transport request while deleting.I am aware in case of any addtion or modifications we select the particular new/modified entry and creat

  • Where is the jazz music in genius playlists?

    I have a large selection of jazz in my library.  However, there is no genius playlists for jazz, but three different groupings for easy listening.  Under what category would I locate the jazz tracks?