473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

IsNull Or IsNotNull problems

I am working on an access 2000 db right now. Here is the problem I am
having, and please let me know if I am not explaining it fully.
I have several tables, 3 of which I want to pull information from and
create a summary query that will be displayed via .asp pages built using
frontpage. Each table has a field called toolordernumber that are
related. Second table has entries that list number of hours worked on
this project. Third shows billing to customers for this project. What I
would like to do is this. Create a summary that must:
1. List all toolorders from main table.
2. List,if any, total number of hours worked on this project *25
3. List, if any, amounts billed for each of these orders.
I have created queries for tables 2 and 3 using the unmatched query
wizard and adding IsNull Or IsNotNull criteria to each of these so they
will show all of the orders from the main table and leave a blank field
if there is none.
Finally, I need to be able to add the cost of the hours worked (number
worked*25) to the customer billing total.
The problem I run into is that I have created the summary to pull the
correct info from each query, but when I try to add the two fields, if
one is null, I get another blank field. What is a workaround for this?
Example
Main Table
Toolordernumber
1
2
3
Hours table
Toolordernumber hours
1 4
1 3
3 2
Invoice table
Toolordernumber invoicecost
1 100
2 50
1 50

In this case, I would see totals for toolordernumber 1, but neither of
the other two because they don't have a matching field from the other
table. i.e. total=[invoicetable!invoicecost]+[hourstable!hours]
would not work.
Please help.

Nov 12 '05 #1
5 21604
To add a little more to this already long post,

I tried adding this to one of the queries

Iif ([hours]="Null","0")
and that did not do as I had expected, which was to place
a zero in each of the fields that contained nothing, so I could
run the add formula in the last post.

Nov 12 '05 #2
Travis...lookup the Nz Function in the Access help. This will solve your
problem...

Good Luck!
Greg Fierro

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
Greg Fierro wrote:
Travis...lookup the Nz Function in the Access help. This will solve your
problem...

Good Luck!
Greg Fierro

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Being pretty much a newbie to Access, I have spent way to much time on
this problem and I wish I had posted this sooner.
I can't thank you enough for the help.

Travis

Nov 12 '05 #4
Greg Fierro wrote:
Travis...lookup the Nz Function in the Access help. This will solve your
problem...

Good Luck!
Greg Fierro

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

OK so now I got everything working great in access, but it pukes out on
me when trying to connect to the database is frontpage to create the asp
pages, I know this is not a fp group but what the hell I thought I
would try.
Here is the error I am getting
[Microsoft][ODBC Microsoft Access Driver] Undefined function 'Nz' in
expression.

Source: Microsoft OLE DB Provider for ODBC Drivers
Number: -2147467259 (0x80004005)

Here is the sql on the query that I am trying to connect to.

SELECT Results.toolordernumber, Results.sellingprice, Results.complete,
Results.expensed, Results.expensed_previously, CCur(Nz([Total_cost],0))
AS Total_cost_w_hours,
CCur(IIf([Total_cust_invoiceamount]>0,[Total_cust_invoiceamount],"0"))
AS Total_cust_invoice,
CCur(IIf([Total_cost_w_hours]>[sellingprice],[Total_cost_w_hours]-[expensed_previously]-[sellingprice],"0"))
AS Expense_this_month
FROM (((Results LEFT JOIN [invfrovendor Query] ON
Results.toolordernumber=[invfrovendor Query].toolordernumber) LEFT JOIN
[invtocust Query] ON Results.toolordernumber=[invtocust
Query].toolordernumber) LEFT JOIN toolroomhours ON
Results.toolordernumber=toolroomhours.toolordernum ber) LEFT JOIN
qry_invoicefrovendorwtrhours ON
Results.toolordernumber=qry_invoicefrovendorwtrhou rs.toolordernumber
GROUP BY Results.toolordernumber, Results.sellingprice,
Results.complete, Results.expensed, Results.expensed_previously,
CCur(Nz([Total_cost],0)),
CCur(IIf([Total_cust_invoiceamount]>0,[Total_cust_invoiceamount],"0"))
HAVING (((Results.complete)="no"));

From the looks of it, frontpage doesn't like the Nz statement. Any ideas?

Nov 12 '05 #5
Travis wrote:
Greg Fierro wrote:
Travis...lookup the Nz Function in the Access help. This will solve your
problem...

Good Luck!
Greg Fierro

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


OK so now I got everything working great in access, but it pukes out on
me when trying to connect to the database is frontpage to create the asp
pages, I know this is not a fp group but what the hell I thought I
would try.
Here is the error I am getting
[Microsoft][ODBC Microsoft Access Driver] Undefined function 'Nz' in
expression.

Source: Microsoft OLE DB Provider for ODBC Drivers
Number: -2147467259 (0x80004005)

Here is the sql on the query that I am trying to connect to.

SELECT Results.toolordernumber, Results.sellingprice, Results.complete,
Results.expensed, Results.expensed_previously, CCur(Nz([Total_cost],0))
AS Total_cost_w_hours,
CCur(IIf([Total_cust_invoiceamount]>0,[Total_cust_invoiceamount],"0"))
AS Total_cust_invoice,
CCur(IIf([Total_cost_w_hours]>[sellingprice],[Total_cost_w_hours]-[expensed_previously]-[sellingprice],"0"))
AS Expense_this_month
FROM (((Results LEFT JOIN [invfrovendor Query] ON
Results.toolordernumber=[invfrovendor Query].toolordernumber) LEFT JOIN
[invtocust Query] ON Results.toolordernumber=[invtocust
Query].toolordernumber) LEFT JOIN toolroomhours ON
Results.toolordernumber=toolroomhours.toolordernum ber) LEFT JOIN
qry_invoicefrovendorwtrhours ON
Results.toolordernumber=qry_invoicefrovendorwtrhou rs.toolordernumber
GROUP BY Results.toolordernumber, Results.sellingprice,
Results.complete, Results.expensed, Results.expensed_previously,
CCur(Nz([Total_cost],0)),
CCur(IIf([Total_cust_invoiceamount]>0,[Total_cust_invoiceamount],"0"))
HAVING (((Results.complete)="no"));

From the looks of it, frontpage doesn't like the Nz statement. Any ideas?

To follow up once again to myself for anyone interested, it turns out
that .asp does not understand the Nz statement so when I would try to
connect via frontpage, it went belly up. The solution was to remove the
Nz statements and replace with the following example.

If(IsNull(qry_invoicefrovendorwtrhours!Total_cost) ,0,qry_invoicefrovendorwtrhours!Total_cost)

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bob Cottis | last post by:
I am getting wierd behaviour with IsNull in ASP. I am passing a string (which may be null) to a function. When the string is null, IsNull seems to return false the first time it is called, then...
2
by: Trev | last post by:
I have two tables, tblMTO and tblIMPORT_MTO. If I import an entire MTO into the import table I want to create a delta from it (i.e. leave only the changed items). I have a view (simplified) ...
6
by: Eric J Owens | last post by:
TIA! I recently moved some forms from an a2k mdb file to an a2k adp. There is now an error when opening one of the forms 'the isnull function requires 2 arguments', but I only find references...
6
by: PerryC | last post by:
Dim TxtField As String TxtField = Me. DoCmd.GoToRecord , , acNewRec Me. = TxtField Question: When Me. IsNull, the script gives me an error "Invalid
1
by: Brent | last post by:
I'm trying to keep the logic of my web pages to a minimum. One of the problems I face regularly is dealing with DBNull's. I know how to code my way out of them, but I thought perhaps it'd be easier...
4
by: Paul Spratley | last post by:
Hi all Firstly this my first time posting to technical groups - so any mistakes I apologise for in advance. I am trying to count records in several secondary tables for the same run in a...
2
by: Raoul Watson | last post by:
I have used isNull statement for as long as I have used VB.. Recently I am devugging a program and it is very clear that the "IsNull" function sometimes would return a true even when the value is...
4
by: jimm.sander | last post by:
Hello, Problem: Im using isnull() in vbscript to determine if a field returned from a ado object call is in fact null. The problem is when I use isnull in anything other than a response.write()...
16
kcdoell
by: kcdoell | last post by:
Hello: When I write new record I have the following code: Private Sub Form_BeforeUpdate(Cancel As Integer) Me!RowIsActive = False 'When a user is creating a new record the following...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.