[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
Here is my SQL query:
SELECT [qry1]![calls]/[qry2]![CountOfCallID] AS count2
FROM qry1, qry2;
Here is my Access query:
count2: [qry1]![calls]/[qry2]![CountOfCallID]
Qry1 is as follows:
SELECT Count(Calls.CallID) AS calls
FROM Calls
WHERE (((Calls.TimeTaken)=[Time]) AND ((Calls.Date)=Date()) AND ((Calls.DateReceived)=[calls]![datetaken]));
Calls is the only table I’m working with and TimeTaken is a column and so on..
Qry2 is as follows:
SELECT Count(Calls.CallID) AS CountOfCallID
FROM Calls
GROUP BY Calls.Date
HAVING (((Calls.Date)=Date()));
These query’s give me a total count of records in 2 diff query’s displayed in one field so that I could divide them and get my percentage. These I can get to display on my labels with no errors.
The percentage query is again:
SELECT [qry1]![calls]/[qry2]![CountOfCallID] AS count2
FROM qry1, qry2;
I have a feeling it has something to do with qry1 and qry2 which only display the count of another query. I've then divided them and multiplied the result to get my percentage which is all that’s displayed in the above query. I'm trying to display this percentage in a label in VB6. I am able to display the count queries in a label in VB but not the percentage.
I'm a newbie with VB6 so am not sure how to proceed. I've tried to select the query in the RecordSource, also tried to input the SQL query in the RecordSource but nothing seems to work. BTW the query works great in Access with no errors.
Any help would be greatly appreciated.
Thanks,
Wyatt