Montgomery County Del. Luiz R. Simmons, who suffered a crushing defeat last week in his bid for the GOP nomination for county executive, could well find solace by remembering the words of the old song: "What a difference a day makes."

For Simmons, the day that made the difference was May 19.

Simmons was on top of the world on Tuesday, May 18. Surrounded by friends and supporters in a cramped room at GOP headquarters, Simmons announced his long-expected campaign for Montgomery County executive with a strongly worded defense of government workers. He accused the last two national administrations -- including the president of his own party, Ronald Reagan -- of making "government employes the object of derision." He criticized Reagan's policy of reducing the size of the federal work force by laying off employes, many of whom live in Montgomery County.

After the speech, a reporter asked the elated Simmons if he were running against Reagan or incumbent County Executive Charles W. Gilchrist. "I'm running against both of them!" Simmons beamed.

At that point, Simmons thought he had no primary opposition. Then the next day, everything started to fall apart.

The morning of May 19, he was quoted in an interview story in The Post's Maryland Weekly unveiling his general election strategy of putting distance between himself and the unpopular policies of the Republican president, especially on the issue of federal layoffs. That same day, the stories on his announcement appeared, complete with his attacks on the Reagan layoffs.

The first angry phone calls and letters from Republicans who were incensed that Simmons would dare criticize the president of his own party came that morning. The same day, Wednesday, a Maryland court declared unconstitutional a section of the Montgomery charter requiring candidates for county offices to have voted in the last four county elections. The decision cleared the way for a politically unknown banker, Joseph C. McGrath, to run in the Republican primary.

Suddenly, Simmons, once considered the front-runner to challenge Gilchrist, had a real primary contest in a party he had just alienated. In attacking Reagan, Simmons had spoken too soon; some would even say he shot himself in the foot.

How Simmons snatched defeat from the jaws of victory illustrates "the razor's edge" between the competing demands of winning over conservatives in their party's primary while appealing to moderate Democrats in November that moderate Republican candidates must walk.

"It's a typical mistake that candidates make," warned Montgomery County Republican Donald Devine, Reagan's director of the Office of Personnel Management and the man responsible for carrying out the federal layoffs. "You can't run away from your president. You have to get through your primary first."

One conservative Republican supporter of President Reagan compared Simmons to Prince George's County Executive Larry Hogan, who in the Watergate year of 1974 ran for reelection to Congress with the strategy of distancing himself from an unpopular Republican president, Richard Nixon. Hogan lost in the primary to a more traditional Republican.

It was a lesson Simmons forgot.

Another liberal Republican, State Sen. Howard A. Denis, also began early putting distance between himself and Reagan on the layoffs policy. Denis, whose Chevy Chase and Bethesda district includes many federal workers, announced publicly that he would boycott a county GOP function because Devine would be the guest speaker. Since he didn't have a primary opponent, Denis could get away with it.

"Lou was just trying to cross a bridge too far," Denis said. "His whole strategy presumed there would be no Republican challenge."

In an effort to control the damage after his opening day salvos, Simmons was forced to aand smile tritely while avoiding reporters' questions.

Liberal Republicans traditionally have found success at the polls in liberal-leaning Montgomery. Denis and Del. Constance Morella have never been torpedoed by the right wing in party primaries, and have gone on to success in general elections.

The difference is that Denis and Morella, while subscribing to a more moderate-to-liberal brand of Republicanism than the right wing prefers, have never done anything to antagonize the conservatives. Denis and Morella may not be beloved by conservatives, but they haven't done anything to make conservatives work against them.

Simmons believes his sin was sponsorship of a controversial bill in the General Assembly that would have taken away some tax breaks for the county's country clubs. He said he got "blown out" in the primary in those affluent precincts of Bethesda and Chevy Chase -- country club territory. He believes the country club issue became the focus for the other complaints about him: that he was too liberal, too out of the mainstream with the county's GOP.

"The country club issue became a theme that was played out in the primary," Simmons said. "It became a theme of the 'too liberal' chant. I didn't believe that it would play the role that it did. It was my assumption that we could escape the snare that was out there." But, he said, with last week's unexpectedly low voter turnout, the "single-shooters" and conservatives of his party had a disproportionate influence in the voting.

Simmons said he believes his campaign was a test of whether a moderate candidate running in a party with arch-conservatives such as central committee members Carole Plante and Forbes Blair would have to be a "quiet moderate" like Denis or Morella. Simmons said he considers himself an active moderate, not just voting a moderate line but playing a highly visible role in championing progressive causes, specifically the country club taxation bill.

"I grew up in a tradition of active Republican moderates," said Simmons, a native New Yorker, "moderates like [former New York Gov. Nelson] Rockefeller, [the former New York mayor who is now a Democrat, John] Lindsay, and [former Sen. Jacob] Javits. The primary was a test of whether or not a Republican could be progressive as well as a spokesman for progressive issues and still survive. We didn't pass that test."

He added, "There's obviously a lot less running room in the Republican party for that kind of role."

Some Republican party insiders, however, said it was more than Simmons' liberal issue positions that alienated him from his party. In the eyes of many conservatives, Simmons was an ambitious single-shooter, too aloof from the official party. After eight years under James Gleason, the last Republican county executive who largely ignored his party, the GOP wanted to make sure the next Republican executive was one of its own.

"He Simmons snubs his nose at the Republican party. He's running for Lou Simmons and that's all he cares about," said Carole Plante, the conservative running McGrath's campaign. "As somebody who's worked in the Republican party, I resent it."

Another conservative Republican, Ed Gannon, said, "The thing about Lou Simmons is he's too much out for himself. Joe [McGrath] represents the true Republicans. He's more in the mainstream of the party."

For now, Simmons plans a rest, and perhaps a short vacation later. Like a good Republican loyalist, he promises to support the nominee of the party, although he said he doesn't know how much time he will have for active campaigning once he resumes his law practice full time. He said he has no plans to switch parties. But he said he also foresees "a period of reflection on the future of the Republican party and my future in the Republican party."