mraetrudeaujr
Technical User
I am trying to adapt a previous SQL statement to work in another database by substituting the appropriate fields, but I keep getting an error stating that my FROM clause syntax is incorrect. I think that it is because I have spaces in the table name, but I cannot figure out how to fix it. Here it is;
I really don't want to change the table name because it will screw up the database, so there has to be a way to show SQL how to accept this table name "tbl_CRIMINAL CASE TRACKING".
PHV was a great help before, so I'm sure that he will recognize this SQL statement. Thanks in advance.
Code:
SELECT [STATION], Sum([OLD_1326_VIOLENT_FELON]) AS [OLD 1326 VIOLENT FELON], Sum([OLD_1326_REPEAT_FELON]) AS [OLD 1326 REPEAT FELON], Sum([OLD_1326_TRIPLE_FELON]) AS [OLD 1326 TRIPLE FELON], Sum([OLD_1326_SUPERVISED_RELEASE]) AS [OLD 1326 SUPERVISED RELEASE], Sum([MEETS_OLD_CASID]) AS [OLD CASID]
FROM tbl_CRIMINAL CASE TRACKING
WHERE STATION Is Not Null
GROUP BY [STATION]
UNION ALL
SELECT "Total", Sum([OLD_1326_VIOLENT_FELON]), Sum([OLD_1326_REPEAT_FELON]), Sum([OLD_1326_TRIPLE_FELON]), Sum([OLD_SUPERVISED_RELEASE]), Sum([MEETS_OLD_CASID])
FROM tbl_CRIMINAL CASE TRACKING
WHERE STATION Is Not Null
I really don't want to change the table name because it will screw up the database, so there has to be a way to show SQL how to accept this table name "tbl_CRIMINAL CASE TRACKING".
PHV was a great help before, so I'm sure that he will recognize this SQL statement. Thanks in advance.