Link to home
Start Free TrialLog in
Avatar of Mike Littlewood
Mike LittlewoodFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Forgotten old syntax


Hi all,

Could someone remind me of some syntax please, Im pretty sure you can do this but let me know if I can't.

I have 2 tables, one is a local Paradox table on my PC, one is an SQL Server on the network.

The paradox one has 2 fields, Quantity and Code
The SQL Server one has 2 fields, ID and Code

What I want to do is select the sum of the quantities from the paradox table based on the list of codes from the SQL Server table.

If it was 2 SQL Sever tables the SQL Text of my TQuery would be nice and easy like this

SELECT Sum( Quantity) AS TotalQuantity
FROM Table1
WHERE Code in
(
  SELECT Code
  FROM Table2
  WHERE ID = :ID
)

What I currently have is

SELECT Sum( Quantity) AS TotalQuantity
FROM "ParadoxTable.db"
WHERE Code in
(
  SELECT Code
  FROM SQLServerTable
  WHERE ID = :ID
)

but it is complaining about the syntax of the statement.
Is this possible, and if so can someone correct the syntax.
Been SOOOO long since I had to touch paradox.
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Littlewood

ASKER

Great thanks for that, been so long since I had to use it.