Home > Crystal Reports > Crystal Reports Error In Compiling Sql Expression

Crystal Reports Error In Compiling Sql Expression

I know how to use Crystal report for reporting purpose but not for extraction.Since my company will not have any sql programmer in future they are planning to do this way. A lot of what I've learned to do with SQL Expressions has been through trial and error.Personally, I prefer to build reports against Views, if possible, and Commands or Stored Procedures, The problem is that CR appears to be checking the SQL expression by itself, without putting it into the context of the main query on the report. What you see as available may not be what I see..So, while SAP can support the feature as a whole, they can't necessarily provide syntax support, nor guarantee effectiveness. Check This Out

During this time, we had upgraded to oracle 10. For example (Oracle syntax):
(
CASE
WHEN PAT_ENC_HSP.HOSP_DISCH_TIME IS NULL THEN
'F'
WHEN PAT_ENC_HSP.HOSP_DISCH_TIME >= PAT_ENC_HSP.HOSP_ADMSN_TIME-7 THEN
'T'
ELSE
'F'
END
https://archive.sap.com/discussions/thread/1822727

Anyone have any thoughts on this? Browse more Microsoft SQL Server Questions on Bytes Question stats viewed: 15844 replies: 11 date asked: May 15 '07 Follow this discussion BYTES.COM 2016 Formerly "TheScripts.com" from 2005-2008 About Bytes You'll need another approach. Cust_id Name Address City State Zip Age Date of Purchase.

If you just need to see the count on the report, the subreport can output the count at the end. In the above examples, MainQueryTable2 contains the payments, and MainQueryTable1 contains the account numbers. My question is : Is there any way to extract the data in Sql server database using Crystal Reports. Tell others by linking to it on your blog or website: href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum IP Logged jjcyeshua Newbie Joined: 22 Mar 2007 Location: United States Online Status: Offline Posts: 30

My only option is to close it without saving changes and reopen it - then it works fine again. Any ideas why? Case statements may be used in SQL Expression fields. Creating SQL Expressions is dependent upon your database and the database driver.

Edited by BrianBischof - 30 Aug 2007 at 4:54pm Please support the forum! But once the validation has failed the report can't be refreshed, so the SQL expression must be marked as bad until it can pass the validation. I have a table that contains details of Customers. The resulting SQL is added to the report's SELECT clause.

Here's Why Members Love Tek-Tips Forums: Talk To Other Members Notification Of Responses To Questions Favorite Forums One Click Access Keyword Search Of All Posts, And More... Msg 102, Level 15, State 1, Line 8 Incorrect syntax near 'sqllims'. 0 LVL 100 Overall: Level 100 Crystal Reports 94 Query Syntax 8 Message Active today Expert Comment by:mlmcc2008-11-18 To accomplish this, PAT_ENC_HSP is omitted from the FROM clause in the query. IP Logged BrianBischof Admin Group Joined: 09 Nov 2006 Online Status: Offline Posts: 2460 Posted: 30 Aug 2007 at 4:53pm This is a pretty generic error message.

SQL Analyzer doesn't know about the other query or the fields in it. his comment is here I want to do this in CR. But here is the really odd part. If you want to learn more about using SQL in Crystal Reports you can read my Expert's Guide to SQL Expressions, Options and Commands, or you can schedule a session with

At first I thought this error was coming from SQL. This expression works in all CR versions: ( SELECT Min ( ONDATE )
FROM GM6.dbo.CAL
WHERE ACCOUNTNO = Contact1.AccountNo ) It is curious that the alias of the CAL I suppose that inner join is the problem, but unfortunately the database structure of our business requires that the payments be kept in a separate table from the account numbers, with http://digitalezines.com/crystal-reports/crystal-reports-gdi-error.html not entirely sure if this helps or even answer your comment...

MenuExperts Exchange Browse BackBrowse Topics Open Questions Open Projects Solutions Members Articles Videos Courses Contribute Products BackProducts Gigs Live Courses Vendor Services Groups Careers Store Headlines Website Testing Ask a Question Should someone know little about SQL to query the database in CR . Now i want a report that conatins only Name,Address and Age.

If you look at the subquery, that is what I am pasting in as a SQL Expression in Crystal but I get the error.

The multi-part identifier Contact1.AccountNo could not be bound. Is this possible? I dont know why i am getting this error Error in compiling SQL Expression Database Connector Error:'42000:[Microsoft][ODBC SQL Server Driver][SQL Server][Incorrect sybtax near the keyword 'select'.[Database Vendor Code:156]' May 18 '07 Not just this SELECT COUNT, but a lot of SQL in my report.Where is the problem in this case?Can we give me some example code that works?

Either the calculation of the total payment on the account takes place after the record selection criteria screens out the most of the payments on the account, resulting in the wrong This tells me that the SQL is fine because it isn't the DB that rejects it. Yes. navigate here Thank you. 0 LVL 34 Overall: Level 34 Crystal Reports 33 Query Syntax 6 Message Active 1 day ago Expert Comment by:James06282008-11-24 Comment Utility Permalink(# a23031991) You're welcome.

Now, I show you 2 problems: 1.