User SQL not work

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
FRED_EMMERICH_(Guest)
Posts: 170
Joined: Tue Oct 10, 2017 12:44 pm

User SQL not work

Post by FRED_EMMERICH_(Guest) » Mon Apr 02, 2007 7:26 pm

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

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: User SQL not work

Post by kfleming » Tue Apr 03, 2007 10:37 am

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

FRED_EMMERICH_(Guest)
Posts: 170
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: User SQL not work

Post by FRED_EMMERICH_(Guest) » Wed Apr 04, 2007 12:02 pm

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

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: User SQL not work

Post by kfleming » Thu Apr 05, 2007 7:52 am

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

FRED_EMMERICH_(Guest)
Posts: 170
Joined: Tue Oct 10, 2017 12:44 pm

====> RE: User SQL not work

Post by FRED_EMMERICH_(Guest) » Thu Apr 05, 2007 9:54 am

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

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

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

Post by kfleming » Mon Apr 09, 2007 9:06 am

You could alternatively build a query in Access and then point the report to that query.____Kathleen__R&R Support

Post Reply