CR8 Function:  CStr(an integer) issues

Posted on 2006-04-13
Last Modified: 2012-05-05
Hi all

I'm passing an integer from a SQL2K SP into CR8 that is a calendar quarter formatted yyyyq, as in 20061 = Year 2006, Quarter 1

I'm trying to create a function that takes the 20061 and converts it to '2006, Quarter 1', but instead I am getting '20,0, Quarter 0'.

My formula:
LEFT(CSTR(ROUND({spr_single_broker_history_summary;1.quarter_id},0)),4) & ' Quarter ' & RIGHT(CSTR(ROUND({spr_single_broker_history_summary;1.quarter_id},0)),1);

Apparently CR is interpreting 20061 as 20,061.00, and my attemps to resolve this in the function have not been successful.

As always, thanks in advance.
Question by:Jim Horn
    LVL 28

    Accepted Solution

    Try it this way:

    LEFT(CSTR({spr_single_broker_history_summary;1.quarter_id},0,""),4) & ' Quarter ' & RIGHT(CSTR({spr_single_broker_history_summary;1.quarter_id},0,""),1);
    LVL 28

    Expert Comment

    Here is a little more elegant method:

    Picture(Cstr({spr_single_broker_history_summary;1.quarter_id},0,""),"xxxx Quarter x")
    LVL 65

    Author Comment

    by:Jim Horn
    Worked great.  Thanks.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    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. …
    Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now