Importing an Access query

  • Thread starter Thread starter Crystal
  • Start date Start date
C

Crystal

I'm trying to import an Access query into an Excel
spreadsheet. The Access query is a totals query:

The SQL looks like this:

SELECT qryBase.STOCK, Sum(qryBase.ACTG_MATL_INVT_QTY) AS
Total
FROM qryBase
GROUP BY qryBase.STOCK;

everytime I try to link it to the Excel spreadsheet, I
get "Invalid character value for cast specification on
column number 2(Total)" I'm assuming it's because I'm
trying to import a totals query. This never happens with
queries that do not use the GroupBy and Sum functions.

Is it not possible to link a totals query into Excel?

Any help would be greatly appreciated,
Crystal
 
What is the field type? Number - Integer?

Are you using MSDE or JET?

I'm not sure, but the following may work (notice the CInt() function):


SELECT qryBase.STOCK, Sum(CInt(qryBase.ACTG_MATL_INVT_QTY)) AS
Total
FROM qryBase
GROUP BY qryBase.STOCK;


Let me know how you get on...

P
 
Back
Top