[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 644
  • Last Modified:

I get SQl error 42P01while executing a Sql query in Crystal Reports XI

I am trying to create a report through SQL in crystal reports XI and the databass is postgresSQL, but I get an error:
Failed to retrieve data from the database.
Details: ADO Error Code: 0x80004005
Source: Microsoft OLE DB Provider for ODBC Drivers
Description: ERROR: relation"tablename" doesnot exist;
error while executing the query
SQL State: 42P01
Native Error" 7 [Database Vendor Code:7]

The query runs fine, when I run it through Postgres studio.

I would appreciate if somebody could help me with this issue
  • 2
1 Solution
What is the query?

How are you adding it to the report?

ReddyUDAuthor Commented:
below is the query:
SELECT "aoadorder"."adordernumber", "aoadorder"."id", "ss_adorder"."discountcodeid"
 FROM  "aoadorder" "aoadorder" INNER JOIN "ss_adorder" "ss_adorder" ON "aoadorder"."id"="ss_adorder"."adorderid"
 AND "ss_adorder"."discountcodeid" ='2'

I selected "create new connection" then "OLE DB (ADO)" then my database and clicked on "add command" where I wrote the above sql query.
And the database is PostGres

Thank you
Try taking the " out.


Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now