Page 1 of 1

User SQL not work

Posted: Mon Apr 02, 2007 7:26 pm
by FRED_EMMERICH_(Guest)
I created a simple 2 table report with User SQL. I get no errors but no data is returned (no filter). When I create a regular report and view the SQL statement it is almost identical, I just changed the table aliases to be 1 letter names. If I copy the SQL from the auto-SQL report into the user-SQL report I get an error that says there is a duplicate field name.____What gives? Any help on why my result set is empty? Database is .mdb.____I have SQL v12____thanks__Fred

=> RE: User SQL not work

Posted: Tue Apr 03, 2007 10:37 am
by kfleming
I just used this SELECT containing single letter aliases against the Xtreme Sample.MDB that ships with Crystal using R&R SQL V12 and did not get an error.______SELECT `C`.`Customer Name`, `O`.`Order Date`__ FROM `Customer` `C` , `Orders` `O` __where `C`.`Customer ID`=`O`.`Customer ID`____Kathleen__R&R Support

==> RE: User SQL not work

Posted: Wed Apr 04, 2007 12:02 pm
by FRED_EMMERICH_(Guest)
I see a lot of confusion regarding the use of the single quotes in names. If I display a SQL statement in an auto-SQL report, they use the single quotes around part of the names, but not all. I see in your example you use the quotes around everything, both the table alias and field name. ____What are the rules for the use of the single quotes?____thanks__Fred

===> RE: User SQL not work

Posted: Thu Apr 05, 2007 7:52 am
by kfleming
They are always required if the object names contain spaces or reserved words. It never hurts to use them around all objects since that saves you from having to determine which ones actually do need them.____Kathleen__R&R Support

====> RE: User SQL not work

Posted: Thu Apr 05, 2007 9:54 am
by FRED_EMMERICH_(Guest)
I tried various combinations of the quotes with no luck. I still get no results and in some cases just an error. When I copied the SQL from an auto-SQL report into a manual one and THAT didn^t work, is disturbing, because I would expect it to work.____This is frustrating since I am trying to do a simple, 2 table join. ____Fred

=====> RE: User SQL not work

Posted: Mon Apr 09, 2007 9:06 am
by kfleming
You could alternatively build a query in Access and then point the report to that query.____Kathleen__R&R Support