Essex Corp., an Alexandria-based defense contractor, yesterday reported a loss of $263,000 for the second quarter and announced that its major contract, involving work on the Trident submarine program, would largely end by Sept. 30.

The Trident work, which had been performed under subcontract to the Electric Boat division of General Dynamics Corp., accounted for approximately $2.6 million, or 20 percent, of 1990 first-half revenue, and about $5 million, or 17 percent, of annual revenue in 1989.

Essex's operations in Mechanicsburg, Pa., and Portsmouth, N.H., will be sharply reduced, resulting in the elimination of about 45 jobs, or about 15 percent of the company's total work force.

Essex, which specializes in training people to operate complex weapons, nuclear plants and other high-technology instruments, has been struggling through a massive reorganization launched two years ago after years of sluggish growth.

The second-quarter loss of $263,000, compared with a profit of $81,000 (6 cents a share) in the 1989 second quarter, reflected the problems associated with two major aspects of Essex's reorganization.

Efforts to expand into commercial markets to replace the Trident business, which had been expected to end, have not yet produced as much revenue as Trident did.

In addition, the acquisition of Systems Engineering and Development Corp., a Columbia, Md.-based information technology and signal processing company that was to be the cornerstone of the push into new commercial high-technology markets, has continued to drain resources from the company.

Excluding SEDC, the company would have reported second-quarter income of $20,000 (1 cent), compared with $132,000 (10 cents) in the second quarter of 1989.

"It has taken longer to bring SEDC up to profitability than we expected," said Essex Chairman Harry Letaw. However, Letaw said, SEDC was critical to winning a $1.2 million contract from Motorola Inc. to perform work on Motorola's recently announced Iridium satellite cellular communications system.

Revenue for the second quarter was $6.4 million, compared with $7.3 million in the 1989 second quarter.

A major factor in the decline in sales was the completion by the end of 1989 of Essex's work as subcontractor to Boeing Corp. on its Navy aircraft maintenance trainer work.

Essex reported a $460,000 loss for the first half of 1990, versus earnings of $110,000 (8 cents a share) for the first half of 1989.

Revenue for the first half totaled $13.1 million, compared with $13.6 million in the first half of 1989.