<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: SQL Expressions generating errors on CRXI and Oracle DB in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455384#M3367148</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah,,, so does it work in CR 2011 against Oracle 11.x? ( CR 2011 does not support Oracle 9, or it's never been tested )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R2 is end of life so we cannot escalate to the developers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, as I indicated I don't recommended using SELECTS in SQLExpressions, it wasn't designed to do that. It's more to add a Function to the report. And even more so in older versions or CR and DB's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why not use it as a command for now and a subreport? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could try turning on Oracle logging to see what the SQL is that CR is sending out. I could be we are generating something wrong server side, actaully from the error we are doing something. We just need to see what the Server is getting to compare syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Odd part is why some work.... could possibly be a NULL value maybe?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MS SQL server is a lot more relaxed in syntax than Oracle is so it doesn't surprise me that it works in MS SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn't work in CR 2011 and Oracle 11.x then we can escalate or even try to duplicate it. No one here even has R2 installed any more so no chance to debug it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn't work in CR 2011 then you cna purchase a support case, you'll get a refund if it's shown to be a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 May 2013 20:07:50 GMT</pubDate>
    <dc:creator>former_member11696</dc:creator>
    <dc:date>2013-05-15T20:07:50Z</dc:date>
    <item>
      <title>SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaq-p/9455380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;I'm having ongoing issues with using SQL Expressions, and I'm hoping that there's some help to be had here. I'm using Crystal v11.5.10.1263, which is SP4 (I know, I know, I'm working with my vendor to get it updated.), against an Oracle 9.2.0.6 DB. The problem is that I keep getting this error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;Error in compiling SQL Expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;SPAN style="font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;Failed to retrieve &lt;/SPAN&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap" id="itxthook0p" style="font-family: inherit; padding: 0px !important; margin: 0px !important;"&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap itxtnewhookspan" id="itxthook0w" style="font-family: inherit; padding: 0px 0px 1px !important; margin: 0px !important;"&gt;data&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt; from the &lt;/SPAN&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap" id="itxthook1p" style="font-family: inherit; padding: 0px !important; margin: 0px !important;"&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap itxtnewhookspan" id="itxthook1w" style="font-family: inherit; padding: 0px 0px 1px !important; margin: 0px !important;"&gt;database&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;SPAN style="font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;Details: ORA-00904:"PS_GENL_DEDUCTION"."EMPLID": &lt;/SPAN&gt;&lt;STRONG style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;invalid identifier&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;[Database Vendor Code: 904].&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;I get this across a wide variety of SQL Expressions. Here's the one that generated the error above:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;H4 style="color: white; font-size: 10px; font-family: Tahoma, Geneva, Arial, sans-serif; padding: 1px 2px 2px 4px; background-color: #777777 !important;"&gt;&lt;SPAN style="color: #575757;"&gt;CODE --&amp;gt; SQL&lt;/SPAN&gt;&lt;/H4&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN style="color: #575757;"&gt;( select max (INNERALIAS."EFFDT") from "PS_GENL_DEDUCTION" INNERALIAS where INNERALIAS."DEDCD" = "PS_GENL_DEDUCTION"."DEDCD" and INNERALIAS."EMPLID" = "PS_GENL_DEDUCTION"."EMPLID" and INNERALIAS."EFFDT" &amp;lt;= SYSDATE ) &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;It's clearly the reference to the table that's in the Database Expert that's causing the issue, as when I replace those table references with discreet values:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;H4 style="color: white; font-size: 10px; font-family: Tahoma, Geneva, Arial, sans-serif; padding: 1px 2px 2px 4px; background-color: #777777 !important;"&gt;&lt;SPAN style="color: #575757;"&gt;CODE --&amp;gt; SQL&lt;/SPAN&gt;&lt;/H4&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN style="color: #575757;"&gt;( select max (INNERALIAS."EFFDT") from "PS_GENL_DEDUCTION" INNERALIAS where INNERALIAS."DEDCD" = 'C1002' and INNERALIAS."EMPLID" = '00021' and INNERALIAS."EFFDT" &amp;lt;= SYSDATE ) &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;...it runs fine, and generates the value expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;Oddly, other SQL Expressions that are quite similar run without issue. For example, this expression is from another report:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;H4 style="color: white; font-size: 10px; font-family: Tahoma, Geneva, Arial, sans-serif; padding: 1px 2px 2px 4px; background-color: #777777 !important;"&gt;&lt;SPAN style="color: #575757;"&gt;CODE --&amp;gt; SQL&lt;/SPAN&gt;&lt;/H4&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN style="color: #575757;"&gt;( select max("PS_ACTN_REASON_TBL"."EFFDT") from "PS_ACTN_REASON_TBL" where "PS_ACTN_REASON_TBL"."ACTION" = "PS_DM_EMPL_HIST_VW"."ACTION" and "PS_ACTN_REASON_TBL"."ACTION_REASON" = "PS_DM_EMPL_HIST_VW"."ACTION" and "PS_ACTN_REASON_TBL"."EFFDT" &amp;lt;= SYSDATE ) &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;...runs fine. There's another that links to the same view as this one does ("PS_DM_EMPL_HIST_VW") that generates the same error as above. I've tried using aliases and not, and using quotation marks and not...neither makes a difference.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;SPAN style="font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;This is a major issue for me, as I'm tasked with converting a stable of reports from an antiquated system to Crystal, and it's critical that I be able to verify that the data pulled is "top of stack" - that the date of a record is the max date for a particular entity, and that the sequence code is the maximum for a particular date. I know that I could accomplish this using subreports, but that's the difference between a report taking a few minutes to run and a few hours. I've tested the SQL code in another &lt;/SPAN&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap" id="itxthook2p" style="font-family: inherit; padding: 0px !important; margin: 0px !important;"&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap itxtnewhookspan" id="itxthook2w" style="font-family: inherit; padding: 0px 0px 1px !important; margin: 0px !important;"&gt;tool&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;, and the issue definitely isn't there. I suspect that there's something about the way Crystal is communicating the table references to Oracle...has anyone else experienced this?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR style="color: #000000; font-family: Tahoma, Arial, Helvetica, sans-serif;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;SPAN style="font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;On a side note, I tried using similar SQL expressions in Crystal 2011 on an SQL &lt;/SPAN&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap" id="itxthook3p" style="font-family: inherit; padding: 0px !important; margin: 0px !important;"&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap itxtnewhookspan" id="itxthook3w" style="font-family: inherit; padding: 0px 0px 1px !important; margin: 0px !important;"&gt;Server&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt; DB, and it worked with no issues at all.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;To summarize, my questions are:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;1)&amp;nbsp; Is this a bug?&amp;nbsp; I've seen other threads online discussing this issue, but none have come to resolution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;2)&amp;nbsp; Could this problem be caused by the fact that they're running SP4?&amp;nbsp; Might upgrading to SP6 resolve the issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;2)&amp;nbsp; Why will very similar SQL Expressions behave differently in different reports, one running properly and the other not?&amp;nbsp; I've tried to find differentiators between them, and I haven't been able to.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;3)&amp;nbsp; Does anyone know of syntax changes I can make to resolve this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 17:34:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaq-p/9455380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-15T17:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455381#M3367145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK so this is unclear, and I don't recommend using SELECT statements in SQLExpressions but others here say it should work... Anyways I would think it's the fully qualified names causing the problem since that is the error being generated by Oracle:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try wrapping all of the references in double quotes, not just the field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;"INNERALIAS"."EFFDT"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;It could be, assuming you are using ODBC, use Quoted Identifiers in the ODBC properties is not checked on, again assuming you are using a driver that supports it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;As a test copy the SQL and create a new report using a Command Object as your data source and see if that works...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that SQL work in SQLPlus?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 18:09:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455381#M3367145</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2013-05-15T18:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455382#M3367146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply!&amp;nbsp; I've tried pretty much every combination I can think of - double quotes, single quotes, no quotes, quotes on field and not table, quotes on table and not field - and no joy.&amp;nbsp; Also, the references that aren't in quotes in the example above are alias references.&amp;nbsp; These work fine as they are in the second example, where I've substituted the table references that are causing the issue with discreet values.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code above wouldn't work in a Command, because a command is not part of the larger report.&amp;nbsp; Correct me if I'm wrong, but I should be able to reference the tables that are in the DB Expert already - right?&amp;nbsp; If I add references in the FROM command to reference these tables, it works fine as a Command.&amp;nbsp; It looks like the SQL expression isn't aware of the report it's a part of when the expression is saved, so references to the tables in the report aren't recognized.&amp;nbsp; This DOES work in CR2011 against a SQL Server DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's another example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;select a.txgrs_ytd&lt;/P&gt;&lt;P&gt;from ps_tax_balance a&lt;/P&gt;&lt;P&gt;where a.emplid = "PS_DM_EMPL_HIST_VW"."EMPLID"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a.company = "PS_DM_EMPL_HIST_VW"."COMPANY"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a.tax_class = 'F'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a.calendar_year = '2010'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a.monthcd = (select max (monthcd)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from ps_tax_balance a2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where a2.emplid = a.emplid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a2.tax_class = a.tax_class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a2.calendar_year = a.calendar_year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a2.company = a.company&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives me the invalid identifier error on the reference to "PS_DM_EMPL_HIST_VW"."COMPANY".&amp;nbsp; If I remove the two references to tables that are in the report and replace them with distinct values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;select a.txgrs_ytd&lt;/P&gt;&lt;P&gt;from ps_tax_balance a&lt;/P&gt;&lt;P&gt;where a.emplid = &lt;STRONG&gt;'00021'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a.company = &lt;STRONG&gt;'01'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a.tax_class = 'F'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a.calendar_year = '2010'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a.monthcd = (select max (monthcd)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from ps_tax_balance a2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where a2.emplid = a.emplid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a2.tax_class = a.tax_class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a2.calendar_year = a.calendar_year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and a2.company = a.company&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...it works fine, and generates the value expected.&amp;nbsp; The only thing that's causing an error is the reference to the table(s) already in the report.&amp;nbsp; As I said above, it's as though Crystal isn't able to recognize the references to the tables that are in the DB Expert as it should.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 18:47:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455382#M3367146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-15T18:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455383#M3367147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another note - Here's another one I'm trying right now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(&amp;nbsp; &lt;/P&gt;&lt;P&gt;select max (EFFDT)&lt;/P&gt;&lt;P&gt;from PS_GENL_DEDUCTION&lt;/P&gt;&lt;P&gt;where PS_GENL_DEDUCTION.EMPLID = "PS_GENL_DEDUCTION_1".EMPLID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and PS_GENL_DEDUCTION."DEDCD" = "PS_GENL_DEDUCTION_1".DEDCD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and PS_GENL_DEDUCTION.EFFDT &amp;lt;= SYSDATE&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this combination of quotes / no quotes on this page:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cogniza.com/wordpress/2005/11/07/crystal-reports-using-sql-expression-fields/"&gt;http://cogniza.com/wordpress/2005/11/07/crystal-reports-using-sql-expression-fields/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It says that quotes are only necessary around table names that are aliased in the main report.&amp;nbsp; It fails the same way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN style="font-style: inherit; font-family: Tahoma, Arial, Helvetica, sans-serif; color: #575757;"&gt;Error in compiling SQL Expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #575757;"&gt;&lt;SPAN style="font-style: inherit; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;Failed to retrieve &lt;/SPAN&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap" id="itxthook0p" style="font-style: inherit; font-family: inherit; margin: 0 !important; padding: 0 !important;"&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap itxtnewhookspan" id="itxthook0w" style="font-style: inherit; font-family: inherit; margin: 0 !important; padding: 0 0 1px !important;"&gt;data&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt; from the &lt;/SPAN&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap" id="itxthook1p" style="font-style: inherit; font-family: inherit; margin: 0 !important; padding: 0 !important;"&gt;&lt;SPAN class="itxtrst itxtrstspan itxtnowrap itxtnewhookspan" id="itxthook1w" style="font-style: inherit; font-family: inherit; margin: 0 !important; padding: 0 0 1px !important;"&gt;database&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN style="color: #575757; font-style: inherit; font-family: Tahoma, Arial, Helvetica, sans-serif;"&gt;Details: ORA-00904:"PS_GENL_DEDUCTION_1"."DEDCD":&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-family: Tahoma, Arial, Helvetica, sans-serif; color: #000000;"&gt;invalid identifier&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN style="font-style: inherit; font-family: Tahoma, Arial, Helvetica, sans-serif; color: #575757;"&gt;[Database Vendor Code: 904].&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN style="font-style: inherit; font-family: Tahoma, Arial, Helvetica, sans-serif; color: #575757;"&gt;But I think it's interesting that the field name has quotes in the error message even though it doesn't in the code.&amp;nbsp; This seems to make it even more likely that the issue lies somewhere in how Crystal is communicating the table/field references to the database.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 19:13:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455383#M3367147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-15T19:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455384#M3367148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah,,, so does it work in CR 2011 against Oracle 11.x? ( CR 2011 does not support Oracle 9, or it's never been tested )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R2 is end of life so we cannot escalate to the developers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, as I indicated I don't recommended using SELECTS in SQLExpressions, it wasn't designed to do that. It's more to add a Function to the report. And even more so in older versions or CR and DB's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why not use it as a command for now and a subreport? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could try turning on Oracle logging to see what the SQL is that CR is sending out. I could be we are generating something wrong server side, actaully from the error we are doing something. We just need to see what the Server is getting to compare syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Odd part is why some work.... could possibly be a NULL value maybe?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MS SQL server is a lot more relaxed in syntax than Oracle is so it doesn't surprise me that it works in MS SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn't work in CR 2011 and Oracle 11.x then we can escalate or even try to duplicate it. No one here even has R2 installed any more so no chance to debug it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn't work in CR 2011 then you cna purchase a support case, you'll get a refund if it's shown to be a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 20:07:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455384#M3367148</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2013-05-15T20:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455385#M3367149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;"Ah,,, so does it work in CR 2011 against Oracle 11.x?"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;Don't know...the only version of Oracle I have available is 9.x.&amp;nbsp; It'll be interesting in a couple months, though...we're going to start using CR2011 with Oracle 9.x.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;We're currently working in an instance of CRXI that's hosted by our vendor, so I don't have the sort of access to drivers and ODBC that I'd like, but I'll ask them to check on the quoted identifiers property.&amp;nbsp; I'll also see if they can check logs for us.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;It wouldn't be a null issue, as I get the same error when I try to get the max of a date field by linking two instances of the same table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;As far as using subreports, I've done that, and it takes FOREVER to run.&amp;nbsp; Literally hours to run a report that would otherwise take minutes.&amp;nbsp; For reports that are being scheduled through BO that's ok, but not for ones that clients are running on their desktops.&amp;nbsp; And we have done some of these reports using Commands, but doing so takes away many of the advantages of using Crystal, such as flexible parameters, using the GUI for report creation, etc.&amp;nbsp; That unfortunately may turn out to be the only way to get it done, though.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 20:44:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455385#M3367149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-15T20:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455386#M3367150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just thought I'd check in again on this.&amp;nbsp; I've seen many references to the issue online that involve newer versions of both Oracle and Crystal, so it would appear to be an ongoing issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I posted this on the Idea board today:&amp;nbsp; &lt;A href="https://ideas.sap.com/ct/ct_a_view_idea.bix?c=A5E8DEA8-D886-4250-BA2B-039F7D32FFC0&amp;amp;idea_id=%7B7731272C-1E72-456B-ACC8-300B1AED93C2%7D"&gt;https://ideas.sap.com/ct/ct_a_view_idea.bix?c=A5E8DEA8-D886-4250-BA2B-039F7D32FFC0&amp;amp;idea_id=%7B7731272C-1E72-456B-ACC8-300B1AED93C2%7D&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I was able to distill this down to the actual issue here.&amp;nbsp; When saving the SQL Expression, Crystal attempts to validate the expression.&amp;nbsp; The problem is that when it does so, it's not taking the main report into account.&amp;nbsp; So, a reference to a table in the main report looks like an invalid reference.&amp;nbsp; Take this simple expression, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(select max(hb.EFFDT)&lt;/P&gt;&lt;P&gt;from PS_HEALTH_BENEFIT hb&lt;/P&gt;&lt;P&gt;where hb.EMPLID = PS_DM_EMPL_CURR_VW.EMPLID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This generates the error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #383838; font-size: 12px; background-color: #ffffff;"&gt;ORA-00904: "PS_DM_EMPL_CURR_VW"."EMPLID": invalid identifier"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #383838; font-size: 12px; background-color: #ffffff;"&gt;It should realize that the reference is to the table in the main report, but it doesn't.&amp;nbsp; If I add a reference to that table to the FROM clause of the expression, the expression saves fine, but it's not going to do the job I need it to - it will be using a separate instance of the table from the one in the main report, and simply evaluates to the max date for the entire table.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 18:01:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455386#M3367150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-21T18:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455387#M3367151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interesting find. So as I noted the version of CR you are using is end of life so we can't fix it. And because you are using SELECTs in a Expression, what happens if you don't and do some simple function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you are correct, because Expressions are NOT Linked to main reports database CR can't handle this situation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Work around is to sue a subreport rather than a SQLExpression. Not linking is not a problem now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I can suggest is to download CR 2011 Trial version and see if that works. If not we may be able to escalate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 20:53:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455387#M3367151</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2013-06-21T20:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455388#M3367152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"...&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;download CR 2011 Trial version&lt;/SPAN&gt;..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish I could.&amp;nbsp; Unfortunately, I'm currently working in a Citrix environment on a vendor's server, so I'm at their mercy regarding what software they provide.&amp;nbsp; I have seen others online complaining of the same issue in CR2011, though, so although I can't test it myself I believe it does exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said in earlier comments, I have tried the subreport alternative.&amp;nbsp; Sometimes it works, but just takes exponentially longer to run; other times, the report fails for lack of resources.&amp;nbsp; Unfortunately, that just isn't a reliable solution for me.&amp;nbsp; Nor is grouping the report and selectively suppressing to show only the records with the latest date...this would require the download of literally millions of records when only a small fraction of those will actually be displayed in the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this point, I'm reduced to writing manual SQL queries and running them as commands.&amp;nbsp; As there's no real interface in Crystal for writing commands, though, this is also a far from ideal solution.&amp;nbsp; The bottom line here is that the SQL Expressions are far and above the ideal method of achieving what I need...if there's any way to escalate this and have it looked at, that would be incredibly helpful!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 21:34:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455388#M3367152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-21T21:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455389#M3367153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;I think you are correct, because Expressions are NOT Linked to main reports database CR can't handle this situation.&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The odd bit is that this DOES work when I'm using a SQL Server db.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 21:37:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455389#M3367153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-21T21:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455390#M3367154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on how you're using the SQL Expression, you may not be able to use a subreport.&amp;nbsp; In that case, you could write a Command to provide the data for your report.&amp;nbsp; A Command is a SQL Select statement using the syntax of the database you're connected to.&amp;nbsp; If you've created parameters in your main report to filter the data, you'll need to delete those parameters and re-create them in the Command Editor in order to filter the data there.&amp;nbsp; A couple of best practices for using commands:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Do not link a command to any tables or other commands.&amp;nbsp; Instead use a single query to return all of the data that's required in the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Do not filter the report data in the Select Expert.&amp;nbsp; Instead, do the filtering in a Where clause in the Command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not following these rules will cause reports to be slow because Crystal will not be able to push the processing down to the server.&amp;nbsp; Instead, it will pull all of the data into memory and link or filter the data there which can be very inefficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 22:07:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455390#M3367154</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2013-06-21T22:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455391#M3367155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup...as I said above, the only option I've found is using Commands.&amp;nbsp; Doing so is very tedious, though, as there's no interface for creating them in Crystal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 23:09:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455391#M3367155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-21T23:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455392#M3367156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure if this helps at all, but what i do when i'm writing reports off of Commands, as i am by nature lazy, is create a report off of tables that at least brings in all of the tables that i need and then creating the joins in the linking expert. by adding a field from each table and also a filter the Database &amp;gt; Show SQL Query can get a good start on the command you have to write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 23:43:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455392#M3367156</guid>
      <dc:creator>JWiseman</dc:creator>
      <dc:date>2013-06-21T23:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455393#M3367157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI, I've never gotten correlated SQL Expressions to work against an Oracle database.&amp;nbsp; I've used SQL Expressions for years (even gave a presentation on them in 2006 for the user conference) and have successfully correlated report data to the external query in SQL Server, DB2 and&amp;nbsp; other databases, but not Oracle.&amp;nbsp; I haven't tried them with every combination of database connection type and driver, but I've tried enough to get me to just pass and go straight to SQL Commands as my report data source when I need the functionality.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 18:53:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455393#M3367157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-01T18:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455394#M3367158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have experienced similar issues before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your Select clause:&lt;/P&gt;&lt;P&gt;--SCHEMA.TABLE.COLUMN (Please do not use an alias)&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp;&amp;nbsp; SOME_OWNER.Suppliers.Supplier_Product_Name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your from clause:&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; Suppliers a&amp;nbsp; -- Remove the Alias, Add Schema Reference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOME_OWNER.Suppliers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your JOINS:&lt;/P&gt;&lt;P&gt;JOIN&amp;nbsp; Warehouse&amp;nbsp; b&lt;/P&gt;&lt;P&gt;SOME_OWNER.Suppliers.Product_id = b.product_id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 04:47:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455394#M3367158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-02T04:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455395#M3367159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the Item in the Select clause--&lt;/P&gt;&lt;P&gt;It allows you to add in Schema.Table.Column Name (Tested today) -- Table Alias is still not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another note --&amp;gt; If your subquery is returning more than one value, try using oracle function: wm_contact&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jul 2013 05:09:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455395#M3367159</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-04T05:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455396#M3367160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sample I have used: &lt;/P&gt;&lt;P&gt;Schema: ORA_OWNER&lt;/P&gt;&lt;P&gt;TABLE: T1_PR_CTL&lt;/P&gt;&lt;P&gt;COLUMN QUERIED ON: VALUE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot to mention in the above posts--Your sub-query in the SQL expression HAS to start with "(" and end with ")".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(select to_date(ORA_OWNER.T1_PR_CTL.VALUE,'dd/mm/yyyy') &lt;/P&gt;&lt;P&gt;FROM ORA_OWNER.T1_PR_CTL&lt;/P&gt;&lt;P&gt;WHERE ORA_OWNER.T1_PR_CTL.PR_NAME= 'DT_VALUE')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jul 2013 05:18:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455396#M3367160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-04T05:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455397#M3367161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for posting, but this doesn't address the actual problem I'm having.&amp;nbsp; The problem is that I can't reference tables in the main report in the SQL expressions.&amp;nbsp; Using an alias for the instances of tables in the expression actually does work.&amp;nbsp; It's when I try to link to a table in the main report that it fails.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2013 16:59:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455397#M3367161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-05T16:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455398#M3367162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, that's what it's looking like.&amp;nbsp; It must have something to do with the way Crystal is sending the expression to the database when the expression is first saved, as that's where the failure takes place.&amp;nbsp; I submitted this issue to their idea board...I'm hoping the developers will find a fix.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2013 17:01:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455398#M3367162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-07-05T17:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expressions generating errors on CRXI and Oracle DB</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455399#M3367163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have you tried to move the where clause syntax between your two tables to the join instead...not sure if it will work or not but perhaps worth a try?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;( &lt;BR /&gt;select max (INNERALIAS."EFFDT") &lt;BR /&gt;from "PS_GENL_DEDUCTION" INNERALIAS &lt;/P&gt;&lt;P&gt;INNER JOIN PS_GENL_DEDUCTION&lt;BR /&gt; ON INNERALIAS."DEDCD" = "PS_GENL_DEDUCTION"."DEDCD"&lt;BR /&gt; and INNERALIAS."EMPLID" = "PS_GENL_DEDUCTION"."EMPLID" &lt;BR /&gt;WHERE INNERALIAS."EFFDT" &amp;lt;= SYSDATE &lt;BR /&gt;) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also as a test, if you were to &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1) take the sql from your report&amp;nbsp; and &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) create a new report off of a comand and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3) then try to add in the sql from your expression (you'll probably have to modify it slightly) as a subquery,&lt;/P&gt;&lt;P&gt; is there an error returned?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jul 2013 20:44:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-expressions-generating-errors-on-crxi-and-oracle-db/qaa-p/9455399#M3367163</guid>
      <dc:creator>JWiseman</dc:creator>
      <dc:date>2013-07-06T20:44:34Z</dc:date>
    </item>
  </channel>
</rss>

