Solved

Crystal Reports - spaces in columns

Posted on 2013-01-26
10
235 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Is the issue with Crystal or the Export?

What version of Crystal?

mlmcc
0
 

Author Comment

by:doctor069
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Had to change the column names to have no spaces in order for it to work
0
 

Author Closing Comment

by:doctor069
Comment Utility
No answer given
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now