Blackburn, Nickels & Smith, Inс., (BNS) appeals from separate judgments dismissing its declaratory judgment action against National Farmers Union Property & Casu *321 alty Company (Farmers Union) and Aetna Casualty & Surety Company (Aetna). We reverse both judgments and remand for a determination of the questions raised.
On Octоber 7, 1985, a vehicle owned by Scott Smith, d/b/a Smitty’s Lawn Service (Smith), and driven by an employee, Mark Dagner (Dagner), collided with a vehicle driven by Kenneth Amstutz and occupied by Kenneth’s mother, Alta Amstutz. Alta and her spouse, Robert Amstutz, filed an actiоn for damages against Dagner and Smith. Kenneth brought a separate action for damages against Dagner and Smith.
This declaratory judgment action involves the applicability of two insurance policies to the acсident. On the date of the accident, Lyle Dagner, Mark’s father, had a personal automobile liability insurance policy with Farmers Union. Aetna allegedly had a liability insurance policy covering Smith in effect on the date of the accident, because in April 1985, Aetna issued a certificate of insurance to Smith for comprehensive automobile liability insurance on Smith’s business vehicles. Both Farmers Union and Aetna denied coverage for the аccident and refused to defend Dagner or Smith in the Amstutzes’ lawsuits.
Dagner and Smith filed a third-party complaint against Rued Insurance Inc. (Rued), alleging that Rued breached its promise to procure a liability insurance policy for Smith with Aetna in April 1985. Dagner and Smith requested contribution or indemnity from Rued for any judgment awarded against them in favor of the Am-stutzes and for costs in defending against the Amstutzes’ lawsuits. Rued, in turn, filed a third-party complaint against BNS, an insurance brokerage firm, alleging that BNS negligently failed to obtain insurance coverage for Smith. Rued requested indemnity from BNS for all amounts Rued would be required to pay on behalf of Dagner and Smith and also sought damages for injury to its business reputation.
Subsequently, Rued paid аnd settled all claims between the Amstutzes and defendants, Dagner and Smith. Rued also paid all of Dagner and Smith’s defense costs associated with the accident. As part of the settlement, Dagner and Smith entered a stipulation dismissing their сlaims against Rued and releasing Rued from any further liability. Dagner assigned to Rued any interest he might have against Farmers Union, as an insured under the policy issued to his father, Lyle.
As a consequence of the settlement, all of the pending lаwsuits were dismissed with prejudice except for Rued’s action against BNS. Rued then agreed to dismiss, without prejudice, its action against BNS for the sole purpose of having BNS bring this declaratory judgment action against Farmers Union and Aetnа. In August 1988, BNS commenced this action, requesting the district court to determine if Farmers Union or Aetna had issued insur- • anee policies which were in effect and provided coverage for the accident.
In BNS’s declaratory judgment аction, the trial court concluded that a declaratory judgment would not settle the controversy among the parties, that the issues raised could better be resolved in other proceedings, 1 and that a declaratоry judgment would not constitute an economical use of the judicial system. The trial court denied BNS’s request for declaratory judgment and, in separate judgments, dismissed the action against both Farmers Union and Aetna. BNS appealеd from both judgments, and the two appeals were consolidated for resolution by this court.
BNS asserts that the trial court erred in refusing to enter a declaratory judgment under Section 32-23-06, N.D.C.C.:
“The court may refuse to render or enter a declaratory judgment or decree where such judgment or decree, if rendered or entered, would not terminate the uncertainty or controversy giving rise to the proceeding. However, the court shall *322 render or enter a declaratory judgmеnt or decree in an action brought by or against an insurance company to determine liability of the insurance company to the insured to defend, or duty to defend, although the insured’s liability for the loss may not have been detеrmined. [Emphasis added.]
Under the first sentence of the above-quoted statute, the trial court’s decision to grant or deny a request for a declaratory judgment is discretionary. The trial court’s decision will not be set aside unless the court has abused its discretion.
Hoops v. Selid,
BNS contends that the second sentence of Section 32-23-06, N.D.C.C., is aрplicable to this case and requires the trial court to issue a declaratory judgment regarding Farmers Union and Aetna’s insurance coverage liability and duty to defend. Farmers Union and Aetna counter that the second sentence of the statute does not apply in this case, because the alleged insureds, Dagner and Smith, have been dismissed, thereby rendering moot the issue of duty to defend.
The language of Section 32-23-06, N.D.C.C., as amended in 1983, which requires the court to issue a declaratory judgment to determine “liability ... to defend, or duty to defend” is, in our view, unclear as to the circumstances under which the trial court must render a declaratory judgment. The quoted language appears to be repetitious. However, in construing a statute, every word, clause, and sentence is to be given meaning and effect, if possible.
Garner Public School District No. 10 v. Golden Valley County Committee for Reorganization of School Districts,
If the language of a statute is ambiguous, the court may resort to extrinsic aids to interpret the statute.
Milbank Mut. Ins. Co. v. Dairyland Ins. Co.,
In United Pacific, supra, an insurer sought a declaratory judgment as to which of two insurers was requirеd to defend and to provide liability coverage for an electric company in a personal injury lawsuit. We held that until there was a final adjudication of the electric company’s liability in the underlying litigation, there was nо justiciable controversy on the issues of the insurance company’s liability or its duty to defend, and we affirmed the trial court’s refusal to grant a declaratory judgment on those issues.
*323 In Aberle, supra, this court, following the rationale of United Pacific, supra, held that a trial court should not render a declaratory judgment to determine an insurance company’s coverage or duty to defend until the underlying lawsuits involving the insured parties had been “tried or settled.”
The issues in United Pacific, supra, and Aberle, supra, involved not merely the duty to defend but also the question of coverage. This сourt held in those cases that neither coverage nor duty to defend could be judicially resolved until the insured’s liability had been determined. It is clear that the 1983 amendment to Section 32-23-06, N.D.C.C., was enacted to reverse the holdings of this сourt in United Pacific, supra, and Aberle, supra. Therefore, we construe the amendment as requiring the trial court to render a declaratory judgment to determine both coverage and duty to defend, 2 whether or not the insured’s liability has been determined.
In this case, the underlying litigation has been settled, and Dagner and Smith have been dismissed as party defendants. The issue which BNS now seeks to resolve is which insurance company, broker, or agent is responsible for the loss and for Dagner and Smith’s costs of defense. The question is viable, not moot, becаuse BNS and others are subject to being held ultimately responsible for the loss and the defense costs. The settlement of the underlying litigation by Rued did not moot the issue of ultimate liability among the insurance companies, brokers, and agents.
See, e.g., American Family Mutual Ins. Co. v. Goetzke,
Farmers Union and Aetna argue that to be entitled to declaratory relief under Section 32-23-06, N.D.C.C., the request for such relief should have been brought before the Amstutzes’ claims were settled. We disagree.
In a footnote in
Allen v. City of Minot,
Rued obviously has an interest in thеse matters which would be affected by a declaratory judgment. Section 32-23-11, N.D.C.C., states in relevant part:
“When declaratory relief is sought, all persons who have or claim any interest which would be affected by the declaration shall be made parties, and no declaration shall prejudice the rights of persons not parties to the proceeding.”
See also Rule 19(a), N.D.R.Civ.P. Consequently, we direct the trial court to order Rued to be joined as a party to these proceedings.
*324 In accordance with this opinion, we reverse the judgments of dismissal and remand for a determination of the questions raised.
Notes
. The trial court was aware that in September 1988, All Nation Insurance Company (All Nation), the no-fault insurance carrier for the Am-stutzes, filed an action against BNS, Rued, Farmers Union, and Aetna, seeking reimbursement for monies it had paid because of the accident.
. In
United Pacific, supra,
we recognized that the question of an insurance company’s liability to indemnify an insured and its duty to defend the insured are separate issues which should be resolved in one action to ”... foster judicial economy and at the same time provide the сourt with a broader foundation of factual information upon which to make a just and expeditious decision.”
