DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 22 Aug 2007 16:29:54 +0100,    posted on: microsoft.public.dotnet.languages.vb.data        back       

Thread Index
  1    Phil N/A


SQL Calculation involving NULL in Access   
I am using an INSERT INTO .... SELECT .... type SQL command, which works 
fine from a query within Access, but doesn't work when I try to execute is 
through an OleDBCommand in  my VB2005 project.
The problem is that the value for one of the fields is calculated from an 
aggregate function which may be Null. I got around this in Access using the 
Nz function something like this:

.... SELECT NZ(Max(Field))+1 ...

but I soon found that Nz cannot be used via OleDb.
For SQL Server I think I can use something like ISNull(Max(Field),0) but 
this doesn't seem to work with Access.
I found a website that suggests using something like this instead of 
Nz(Value):

IIF(ISNull(Value),0,Value)

but I am concerned that if I replace Value with Max(Field) this will 
evalulate the Max function twice, and have an impact on performance. Is this 
a problem? and if so, is there a better way to do this?

TIA
Phil
Date:Wed, 22 Aug 2007 16:29:54 +0100   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us