Solved

Nz Function and Visual Basic

Posted on 2003-11-14
7
615 Views
Last Modified: 2013-12-25
I'm using Nz function in Access-2000 query without any problem.
But what i want is to use Nz function directly through recordset in Visual Basic. I don't want to use Access Query due to some reasons. I'm using VB-6.0 and ADO. But in this case it's giving me error unrecognized Nz Function. Following is the snippet that i'm using:

dim rs as New ADODB.recordset
rs.open "select Nz(Sum(qty),0) From Tab1 Where Sno = 5",cn,.....

It's giving error in this statement. What could be the problem. Please help......

thanx and regards,
jigyasa
0
Comment
Question by:jayakul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 9753649
Try:

Select Sum(Qty) From Tab1 Where Qty is Not NULL

?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9754478
Please maintain your old open questions:

1 02/04/2003 300 access to shared folders through vb appl...  Open Windows NT Networking
2 09/16/2003 250 Import MS-Access-2000 Data to SQL Server...  Open VB Databases
3 10/02/2003 50 File Field Control  Open JavaScript
4 10/02/2003 150 Multiple Columns With Restricted Detail ...  Open Crystal Reports

Thanks,
Anthony
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 9764215
Try this:

Select Sum(Qty) From Tab1 Where Qty Is Not NULL AND Sno = 5

Leon
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

Author Comment

by:jayakul
ID: 9776777
i've got the solution. The code i've written in the question is just a snippet, I can not use these simple Select Queries with check for Null. I need to have something sort of Nz function only. Following Statement can be used in place of Nz function, becoz Nz can not be used from VB. this i got from some other site....

IIf(IsNull(Sum(Qty)), 0, Sum(Qty))

This works fine. thanx for the sincere efforts. i'm closing this question now.


0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9779885
Do you need help closing your old open questions.

Anthony
0
 
LVL 1

Expert Comment

by:ayufans
ID: 10512061
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- PAQ'd and points refunded

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

ayufans
Cleanup Volunteer
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 10544522
PAQed, with points refunded (100)

CetusMOD
Community Support Moderator
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month7 days, 7 hours left to enroll

632 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