CR8 Function: CStr(an integer) issues

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.
-Jim
LVL 66
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bdreed35Commented:
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);
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bdreed35Commented:
Here is a little more elegant method:

Picture(Cstr({spr_single_broker_history_summary;1.quarter_id},0,""),"xxxx Quarter x")
0
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Worked great.  Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.