Solved

Access 2000 need an alternative to NZ function

Posted on 2007-03-22
10
674 Views
Last Modified: 2013-11-27
I am using the NZ function in the fiels location.
Notes: NZ([purchaseorderdetail].[Notes],"")

I am having trouble importing this query into a 3rd party program. This program doesn't like this NZ function. When I take out the NZ function it imports perfectly. When I put the NZ function back into my query, the program doesn't want to connect. It says " Value cannot be null. Parameter name: adodb."

I need another way to do my NZ function without using it in the field location, so my 3rd party program will connect to my query.
Please let me know if you need more info or clarity.
Thanks
0
Comment
Question by:mancoi
  • 3
  • 2
  • 2
  • +2
10 Comments
 

Author Comment

by:mancoi
ID: 18773833
I posted a screen shot of the details section of my query.

http://download.yousendit.com/CDCE878C630B8DC5 

 
0
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 50 total points
ID: 18773842
try this in place of the NZ function:

Notes: [purchaseorderdetail].[Notes] & ""

this will append a "" (zero-length string) onto the values from the table, which will *not* affect notes that have real text, but will convert any NULL values to a zero-length string, which is precisely what your use of the NZ function is doing.


AW
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 18773862
try this

Notes: NZ([purchaseorderdetail].[Notes],Null)

Is the [Notes] field allow zero length property set to yes
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 38

Assisted Solution

by:Jim P.
Jim P. earned 50 total points
ID: 18773911
These are foreign tables in Paradox?  That you are connecting using ADO?

You'll have to dig around in the Paradox guide for that function. In Transact SQL (MS SQL version of SQL) the function is IsNull(MyField,'').
Oracle uses NVL(MyField,'').
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 100 total points
ID: 18773950
The below code is the VB equivalent of Nz, as VB does not have Nz.  Perhaps you can re-write it to be Paradox-friendly...
____
Public Function Nz(vValue as Variant, Optional vValueIfNull as Variant) as Variant

If Not IsNull(vValue)
   Nz = vValue
elseif IsNull(vValue) and (Not IsNull(vValueIfNull) then
   Nz = vValueIfNull
elseif IsNull(vValue) and IsNull(vValueIfNull)
  'User passed null values in both vValue and vValueIfNull.  Put what you want here, like...
   Nz = ""
end if

End Function
0
 

Author Comment

by:mancoi
ID: 18782346

Check this site out.....

How can I change my function to an IIF function? I am using ......Notes: NZ([purchaseorderdetail].[Notes],"")

http://tutorials.aspfaq.com/8000xxxxx-errors/can-i-use-the-nz-function-without-getting-80040e14-errors.html
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 300 total points
ID: 18782655
Notes:IIf(Len([purchaseorderdetail].[Notes])>0,[purchaseorderdetail].[Notes],"")
0
 

Author Comment

by:mancoi
ID: 18782677
Got it using an IIF I will award points....THANKS
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 18782852
Glad to be of assistance. May all your days get brighter and brighter.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 18783720
glad to be of assistance.

AW
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question