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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Expression Editor

Status
Not open for further replies.

babyblu

Programmer
Mar 30, 2001
7
US
Hi,

I am using the SQL Expression Editor in ver 8.5 and my problem is when I type in the SQL expression into the text box I am getting a syntax error on the first line of the SELECT statement.

I have used the same syntax as the help text displays to use but it still gives me an error.

I noticed that the help text uses single quotes around column names but that the SQL Expression Editor places double quotes around the column name when I double click a column to be added. But I get the same error no matter which set of quotes I use.

Can anyone shed any light on this error.

The statement is
SELECT
TSP_COMPONENTS.'NAME'
FROM
'TSP_COMPONENTS' TSP_COMPONENTS
WHERE
TSP_COMPONENTS.'ID' = TSP_TIMEENTRIES.'IDS_1'

Any help would be greatly appreciated, is this a quirk or am I being completely dense?

Thanks a bunch

Johnie
 
Hi

You're not dense. I use the SQL editor to VIEW the SQL statement. I always build my selection through the Select Expert. This way I get the syntax correct, I have drop down menus, field lists etc

I can't think of an occasion when I have needed to use the SQL editor to build a SQL statement.

Good luck

George
Consultant and trainer
georgea.cts@dial.pipex.com
 
Ahhh - another company using TimeSheet Professional?

First of all, your WHERE clause is referencing another table (TSP_TIMEENTRIES). How does that play into this statement? Also, have you tried using no quotes??

SELECT
TSP_COMPONENTS.NAME
FROM
TSP_COMPONENTS
WHERE
TSP_COMPONENTS.ID = TSP_TIMEENTRIES.IDS_1

The quotes, single or double, are normally used to surround text, instead of column names.

I hope I'm not too wrong on this one.
 
You are discussing two different things.
There is a SQL expression editor within CR.
There is the SQL designer that is an external tool.

The SQL expression editor is used to add a column to your results. It can't contain a SQL Statement (ie Select...from...Where), only an expression that can add a single column, using the SQL functions and fields available in the existing tables.

The SQL designer is used to create an entire SQL statement. This can then be used as the source of a report.

babyblu probably needs a subreport, because he is trying to do a subquery. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top