Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Value in a View 1

Status
Not open for further replies.

tis9700

Technical User
Jun 18, 2003
100
US
Hi everyone,
I haven't found anything on this topic so I'm just going to ask it.

I have a view that counts the number of classes (TtlClasses) an Instructor has taught. It is comprised of two tables, Instructors and Classes. And they are linked with a Left Outer Join on the Instructor table to show all Instructors, even those that have not taught a class.

Is it possible to set a default value of 0 in a view so that those Instructors who haven't taught a class (TtlClasses) doesn't just have a blank or null?

Thanks a bunch!
 
Coalesce(Count(*), 0) As ClassCount

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Sorry,
I meant to say a table and a view. Instructors (table) and TtlClasses (View with count function. It counts the classes in the Classes table).

Need coffee now!!
 
Hi gmmastros,
This is the second time you've come to my rescue in the past couple of weeks. Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top