cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Expressions

Former Member
0 Kudos
50

Hi SAP,

I would like to know what the proper syntax is when using SQL Expressions in Crystal 11. I keep getting the same error message in Crystal when saving that states there is incorrect syntax near the keyword select.

Also, is there some documentation that briefly explains when it's a good idea to use SQL Expressions?

Thanks in advance,

- Zack H

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Put everything in brackets.

(select whatever from whereever)

It embeds that SQL expression in the parent SQL statement, so it needs to be in brackets.

Former Member
0 Kudos

Thanks Iain,

The paranthesis around the statement worked when I selected on an arbitrary employee ID. It didn't seem to like the paramter I had in my statement. Is there a way to use parameters in the SQL expressions or is that not possible?

Zack H

Former Member
0 Kudos

Hi Zack,

You cannot use any parameters or formulas in SQL Expressions. The query sholud be static and the output should be scalar (only one value). As a workaround you need to use add command and pass the values to your parameter.

Regards,

Raghavendra

Former Member
0 Kudos

Is there any documentation on SQL expressions for Crystal 11?

Former Member
0 Kudos

The following article would explain about SQL Expressions.

[https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]

Regards,

Raghavendra

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Raghavendra.

Former Member
0 Kudos

SELECT employee_lastname

FROM employee

WHERE employee_id={?Employee ID}

I never really used SQL expressions and would like to understand how this feature works in Crystal 11.

Any help would be much appreciated.

Thanks,

Zack H

Former Member
0 Kudos

please place your syntax here, makes it much easier to help you