Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default MSQuery and NZ()

I have a stored query in Access I use to export a "flattened" version of my
highly normalized database. It's exported to excel.

I have recently taught my users to use MS Query from excel, targeting the
stored "flattened" query. Unfortunately, due to the prevelance of nulls in
certain field used for calculations, I use the NZ() function alot in the
"flattened" query. It calculates dollars from the sum of several
multiplications, so it's important to be there in exactly the right way for
consistency. I could force the user to do the calcs in Excel, but I'm certain
they'd lose consistentcy and rounding.

Example:

TotalDlrs:
CCur(Round(Round(nz([stdhours])*nz([strate]),2)+Round(nz([othours])*nz([otrate]),2)+Round(nz([dthours])*nz([dtrate]),2),2))

If any of the fields (rates, hours) were null, the whole equation comes out
to 0 (null).

When my users target my "flattened" query from excel, they get an error
saying the "nz()" function is not found. How can I overcome this?

--
Jim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default MSQuery and NZ()

Not sure if this helps but you can give it a look...

http://www.dailydoseofexcel.com/arch...5/nz-function/
--
HTH...

Jim Thomlinson


"JimS" wrote:

I have a stored query in Access I use to export a "flattened" version of my
highly normalized database. It's exported to excel.

I have recently taught my users to use MS Query from excel, targeting the
stored "flattened" query. Unfortunately, due to the prevelance of nulls in
certain field used for calculations, I use the NZ() function alot in the
"flattened" query. It calculates dollars from the sum of several
multiplications, so it's important to be there in exactly the right way for
consistency. I could force the user to do the calcs in Excel, but I'm certain
they'd lose consistentcy and rounding.

Example:

TotalDlrs:
CCur(Round(Round(nz([stdhours])*nz([strate]),2)+Round(nz([othours])*nz([otrate]),2)+Round(nz([dthours])*nz([dtrate]),2),2))

If any of the fields (rates, hours) were null, the whole equation comes out
to 0 (null).

When my users target my "flattened" query from excel, they get an error
saying the "nz()" function is not found. How can I overcome this?

--
Jim

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
msquery patti Excel Discussion (Misc queries) 4 January 17th 08 03:17 AM
msquery troestj Excel Discussion (Misc queries) 1 September 25th 06 02:31 PM
MSQuery Lac Excel Worksheet Functions 2 June 14th 06 08:49 AM
MSQuery Optimization BAC Excel Programming 0 March 3rd 06 07:58 PM
Using Case in MSquery LBIdydys Excel Programming 1 December 17th 05 04:00 AM


All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"