Print Page | Close Window

Part Description too long - need function/formula?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9127
Printed Date: 04 May 2024 at 6:55am


Topic: Part Description too long - need function/formula?
Posted By: aeromonte
Subject: Part Description too long - need function/formula?
Date Posted: 16 Feb 2010 at 7:38am

Hi,

We are using an ERP system (Epicor Vantage) and Crystal Reports 11.  A few of our reports, that include parts and part descriptions in them, "bomb" if the part description is too long (over so many characters).  Most of the time, we can find the part/s with the long description/s and shorten the description/s to fix the issue.  However, this time, we can’t.

I am looking for a simple Crystal report with a formula/function to include part.partnum and some type of function for part.partdescription to count or show which decriptions are the longest (just the Part table would be needed).   I could then sort decending by the count number and find the culprit part descriptions.

I tried LEFT and LEN/LENGTH and the report still bombs probably because it still had to pull the long  description in first in order to trim or count it. 

I also contacted our ERP tech support and they sent me an email with this:

SOLUTION:

In some cases the problem is that the data you are trying to retireve is just simply too large.  You can try the SUBSTR function in your SQL statement.  Below is an example of what that might look like, Part Description is used for this example.

 

SELECT SUBSTR(PartDescription, 1, 100) shortPartDesc FROM PUB.Part

 

This will work if you're using a pass-thru query and if you want the whole description, you can pull it down in pieces:

 

SELECT SUBSTR(PartDescription, 1, 100) PartDesc1, SUBSTR(PartDescription, 101, 100) PartDesc2 FROM PUB.Part

 

I don’t think that SUBSTR is a function in Crystal (at least I could not get it to work)…  This "concept" seems like it would work however. 

Anyone have any ideas?

Thanks so much!

John



Replies:
Posted By: kevlray
Date Posted: 16 Feb 2010 at 7:58am
Did a little research for you, I am assuming you are using a Microsoft SQL Server connection.  If so, then the function is substring(string, start, length)


Posted By: aeromonte
Date Posted: 16 Feb 2010 at 8:13am
Kevlray, thanks for helping out! 
We are actually not using a SQL Server connection (kind of wish we were). 
Our database is Progress and we use an ODBC connection to it. 
 
I am trying to find a function in Crystal Reports or even from a MS Access query via ODBC. 
 
When trying to pull all parts/part descriptions In Access, I get ODBC-call failed: a partdescription in table pub.part has exceeded its max length or precision.


Posted By: kevlray
Date Posted: 16 Feb 2010 at 8:24am
I do not know the progress DB, thus I do not know what functions are available for it.   As far as Access, it has a lot of limitations, so I do am not sure what you can get away with.
 
Lots of Luck.



Print Page | Close Window