Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change length of field type 1

Status
Not open for further replies.

ksbigfoot

Programmer
Apr 15, 2002
856
CA
I am using CR 10.
I am looking at the field explorer where it shows the Database fields in which I am calling a View from SQL Server. It shows all my fields in my view.
I right clicked on my view and clicked 'Show Field Type'.
One of my fields is a string [10]. But when I look at my table in SQL Server it is a char [20].
How do I fix the length of the field so my data is not truncated.

Thanks
 
I also checked the 'Database, Show SQL Query' and it pulls back the full field not truncated. It is because the field in the field explorer is truncated to string [10] instead of string [20].
 
Are you positive that the person creating the View didn't mistakenly hardcode in a length of 10? I'd be most suspicious of that.

If that is not the case, try using a SQL Expression, and enter:

substring(table.field,1,20)

Now use the SQL Expression and see if that shows all data.

I've never heard of Crystal truncating a field, so I'm very curious how this works out.

Please make sure that your service packs are up to date, and you might also try switching connectivity from OLE DB to ODBC or vice versa to see what happens then.

-k
 
Howdy Synapsevampire,
I think what happened is that when the report was originally created the field was of length 10, the the field was updated later to 20.
I did the 'Set Datasource Location' and the length was still 10. So what I did to fix it was I took the field out of the view, so then it was also taken out of the crystal report. I then added the field back into the view and back into the crystal report and it is showing a length of 20. So now it is working.
Star to you for all the help.
ksbigfoot.
 
Using Database->Verify Database should have done the same thing.

Had I considered that you were working on an existing report rather than initially viewing the report I would have suggested that first

-k
 
Howdy Synapsevampire,

Thanks, I am not sure if I clicked on the Database -> Verify Database, but I will make sure I do that first next time I have a problem.

Thanks again,
ksbigfoot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top