tags:

views:

51

answers:

1

First of all I know this is probably bad sql but I just need to run a few queries of this and it will not go into official use anywhere.

I need to find some records from the fcc uls database so I got the tables and they have one table with locations and one with frequencies for a number of categories. So what I've done is run queries to join the location and frequency tables each category and the run a union query on these to get all the records in one table.

Now I want to run a query on the union query to pull up records that only match certain coordinates but I keep getting a the error "Syntax error (missing operator) in query expression '(All.latd)'" Is there anyway to actually run a query on a union?

SELECT (All.latd),  (All.latm),  (All.lats),  (All.lond), (All.lonm), (All.lons),     (All.freq)
FROM All
WHERE (latd =37) AND (latm=53) AND (lond=76) AND (lonm=37);
+4  A: 

All is a reserved word, you need square brackets.

SELECT [All].latd, [All].latm, [All].lats, [All].lond, 
[All].lonm, [All].lons, [All].freq
FROM [All]
WHERE latd =37 AND latm=53 AND lond=76 AND lonm=37;
Remou
It worked!!! thanks, can't believe I didn't think of that.
You could keep the parens in the WHERE clause, though. Those are there for unrelated reasons.
David-W-Fenton