Solved

Crystal Reports - spaces in columns

Posted on 2013-01-26
10
238 Views
Last Modified: 2013-02-01
Hi -
I am using CR10 and trying to create a report that has spaces in the column name

In CR the sql statement looks something like this

SELECT
table_name1.LastName
,table_name2.User id
FROM table_name1
INNER JOIN table_name2
ON table_name1.id=table_name2.User id

This gives a error in SQL so it should look something like this:
SELECT
table_name1.LastName
,table_name2.[User id]
FROM table_name1
INNER JOIN table_name2
ON table_name1.id=table_name2.[User id]

Is there any way to change this in CR10 so that it sends the proper format to the sql server

Thanks in advance
0
Comment
Question by:doctor069
  • 5
  • 5
10 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 38822820
Try this

SELECT
table_name1.LastName
, 'table_name2'.'User id'
FROM table_name1
INNER JOIN table_name2
ON table_name1.id= 'table_name2'.'User id'

mlmcc
0
 

Author Comment

by:doctor069
ID: 38822853
thanks mlmcc but how is that done in crystal reports.

I just drop the field onto the report and crystal creates the sql
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 38822914
Did you select the tables and just putting the fields on the report?
If so, Crystal should add the appropriate deliiters to the SQL.

mlmcc
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 100

Expert Comment

by:mlmcc
ID: 38822919
Is the issue with Crystal or the Export?

What version of Crystal?

mlmcc
0
 

Author Comment

by:doctor069
ID: 38822934
Crystal 10
Yes, I select the tables and put the fields on the report.

When I view the SQL (Database -> Show SQL Query) in Crystal it has not added the anything to accommodate for the space.

table_name2.User id needs to be table_name2.[User id]

So I get a SQL error when running the report
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 38822964
Try a VERIFY DATABASE.

Another idea would be to delete that table from the report then run the report and then add the table back.

mlmcc
0
 

Author Comment

by:doctor069
ID: 38822973
Database verify says "Up To Date"

I removed the table, ran report (no issues) then error again when I added.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 38823256
No idea.   I generally use fieldnames with no spaces or use underscores for them.

When you select the tables you can't change the SQL that is generated.  Almost sounds like there is a problem with your Crystal install.

Is it a full version of Crystal 10 or one of the versions that came with Visual Studio?

Do you have Visual studio 2003, 2005, or 2008 installed?
If so is Crystal for Visual Studio installed?

mlmcc
0
 

Accepted Solution

by:
doctor069 earned 0 total points
ID: 38825560
Had to change the column names to have no spaces in order for it to work
0
 

Author Closing Comment

by:doctor069
ID: 38843119
No answer given
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

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…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

777 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