User SQL not work
-
- Posts: 170
- Joined: Tue Oct 10, 2017 12:44 pm
User SQL not work
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
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
-
- Posts: 170
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: User SQL not work
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
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
-
- Posts: 170
- Joined: Tue Oct 10, 2017 12:44 pm
====> RE: User SQL not work
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
You could alternatively build a query in Access and then point the report to that query.____Kathleen__R&R Support