Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2004, 12:29 AM
Authorized User
 
Join Date: Aug 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sinapra Send a message via MSN to sinapra Send a message via Yahoo to sinapra
Default The isnull function requires 2 arguments.

Hi
I am getting the following error. I am using SQL Server DB.
My query looks like :
SELECT Register.Register, Register.SR_Num, Register.CSC_Project_Code, Register.Project_Common_Name, Sum(IIf(IsNull([StakeHolders].[StakeHolders]),0,IIf([StakeHolders].[Status],1,0))) AS StakeholderCount FROM (Register INNER JOIN SR_Status ON Register.SR_Status = SR_Status.SR_Status) LEFT JOIN StakeHolders ON Register.Register = StakeHolders.Register WHERE (((SR_Status.Status)='Active')) GROUP BY Register.Register, Register.SR_Num, Register.CSC_Project_Code, Register.Project_Common_Name ORDER BY Sum(IIf(IsNull([StakeHolders].[StakeHolders]),0,IIf([StakeHolders].[Status],1,0)))

Can anyone explain where the actual problem is? Can we use IIF in SQL Server, the queries are designed earlier before I joined this project.

Regards everyone

sinapra
__________________
sinapra
 
Old August 30th, 2004, 07:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

No IIF support, but you can use ISNULL. I'm not sure of some of the purposes of your IIF statements; you may be able to use a SQL Server case statement instead.

, case
    when <condition> then
    when <condition> then
    else
end,

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Procedure or function has too many arguments Raby VB Databases Basics 6 November 16th, 2007 11:38 AM
Beginner requires a little help!? Koko Brown Flash (all versions) 2 August 16th, 2007 01:45 AM
Passing multiple arguments to function zarikiane XSLT 2 July 18th, 2006 09:35 AM
Dates and isNull lic023 Access VBA 3 July 12th, 2004 12:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.