ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calculation on data from SQL database sing MS Quwry (https://www.excelbanter.com/excel-programming/419112-calculation-data-sql-database-sing-ms-quwry.html)

cesar

Calculation on data from SQL database sing MS Quwry
 
Hi all,

I'm pulling data from a SQL database using MS Query in Excel, I have
filters or criteria on the query before to bring the data to excel. Once in
excel I am creating new columns by using the data just retrieved. The problem
is when I change my criteria, ( in this case I am using Date range), the
values on the new columns shows #REF!. Being more especific, if the 1st time
I retrieved let say 20 rows, then my new columns calulate the new 20 values,
but next time I retrieve data using a new value in the criteria I got let
say, 30 rows but in my calculated new columns I got values up to the raw 20
but from there up to the raw 30 I got #REF!.
--
Cesar

joel

Calculation on data from SQL database sing MS Quwry
 
The #REF is being caused by a worksheet formula the can't find a reference.
You need to debug the formula. the way I normally debug a formaul is to use
the Evalaute formula tool. click on one of the cells with the error then
from worksheet menu

Tools - formula Auditing - Evaluate Formula.

Post the formula if you need help. If you are creating the formula from VBA
code also include the code that writes the formula.

"Cesar" wrote:

Hi all,

I'm pulling data from a SQL database using MS Query in Excel, I have
filters or criteria on the query before to bring the data to excel. Once in
excel I am creating new columns by using the data just retrieved. The problem
is when I change my criteria, ( in this case I am using Date range), the
values on the new columns shows #REF!. Being more especific, if the 1st time
I retrieved let say 20 rows, then my new columns calulate the new 20 values,
but next time I retrieve data using a new value in the criteria I got let
say, 30 rows but in my calculated new columns I got values up to the raw 20
but from there up to the raw 30 I got #REF!.
--
Cesar



All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com