Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Adding NULLs

Author  Topic 

BillyWardrop2345
Starting Member

9 Posts

Posted - 2005-08-31 : 05:05:52
I have two tables - software and software assigned. Every time a piece of software is assigned to a PC or Server, a new entry is put in the software assigned table specifying PC or Server.

I then created an sql query that would join both tables and displays all software records and displays a count of records in the softwareAssigned table that each piece of software has - making some software entries null. From these figures, I need to generate the total licence count for each piece of software generating some null values.

Could I have the system enter 0 as a row count when no software is assigned?

Am I on the right lines or have I completely over complicated it?

I hope you understand where Im coming from.

Many Thanks


Billy

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-31 : 05:12:10
Instead of Sum(field), use Sum(IsNull(Field,0))
Otherwise post table strucures and the query you used

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

BillyWardrop2345
Starting Member

9 Posts

Posted - 2005-09-02 : 09:38:21
Spot on! That worked perfect.

Thanks
Go to Top of Page
   

- Advertisement -