Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

CR8 Function:  CStr(an integer) issues

Posted on 2006-04-13
3
Medium Priority
?
1,086 Views
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.
-Jim
0
Comment
Question by:Jim Horn
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
bdreed35 earned 2000 total points
ID: 16447562
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
 
LVL 28

Expert Comment

by:bdreed35
ID: 16447583
Here is a little more elegant method:

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

Author Comment

by:Jim Horn
ID: 16447598
Worked great.  Thanks.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Loops Section Overview
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

581 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