We looked up templates that stated a clear formula. There's a good example of the sort of examples you find at http://www.charlottedillon.com/query.html:
Date Editor or Agent's Name Publisher or Agent's Address Dear Ms. Name, To start off, give the name and length and type of manuscript you are sending...
Standard fare. Ok, we started building a template.
Once we had a general description of the book that fit the formula, we started scanning sites that gave more in-depth examples, preferably lots of them. For example, my personal favorite, Janet Reid's Query Shark. Wow, what a goldmine...
But then, we realized how utterly inappropriate our query was, precisely because we were doing what so many other sites had said to do. How could that be? I mean, these were examples from experts, in writing, on the WEB for goodness' sake...
And the Peanut Gallery says "Ah."
Even I, the monumentally dense classic example of the charming nerd, eventually came to realize that this is not computer science. There is no query-reading machine spitting out punch-cards stating YES WE WILL TAKE THIS BOOK (beeeeep), or NO THIS ONE IS STUPID (buzzzzz). The people to whom we were sending queries were people, human beings with lives and moods and prejudices, who drink coffee and miss breakfast and have arguments with spouses or bosses or idiots on the freeway.
Oh, my. How could we ever write a query that would work in this chaotic morass of humanity?
Well, the simple answer is, you get incredibly lucky, and just happen to send the query to the person who likes them the way you've done it and likes the idea, the voice, and the prospects of the sale. Personally, I think you'd have better odds to just drop two years of your life on Black 13 at a roulette table.
Skip the simple answer. That's not the way real life works. Stop trying for an easy solution. You've spent months and months of effort developing characters, plot, setting, tension, rising action and reader rapport, researching details and honing dialogue...now you're going to balk at having to do a little more homework?
Yes, more homework. If you're planning to send your query to Janet Reid, then for God's sake read the Query Shark blog - ALL of it - and customize your query to something that truly represents your work in the way most likely to garner her interest. Even if you aren't going to send it to her, read her blog anyway, but understand not every agent thinks the same way. Others will dismiss your query for not doing something that she will possibly reject you for including, but you should still look at everything she has to say, because a lot of it is just good sense, and even where her tastes differ, reading it will help you find your own voice for the query itself.
If sending to an agency that always wants genre and wordcount up front, rewrite the query for them. Put the genre and wordcount up front. Try to find out what that agent wants. Sarah LaPolla (Big Glass Cases) says she hates prologues; if you're sending pages, consider renaming it to chapter one, or dropping it altogether for her. (Though if the book stands without it, should it really have been there anyway?)
Sending queries is stressfull. My wife and I both laugh about the send-button blues, where we sit with the mouse pointer hovering near SEND but don't click yet, giving ourselves just a few more minutes to think of that mysterious something we have inevitably forgotten.
Yet the work has helped. We finally have a request for a manuscript, though not an offer of representation yet. We're optimistic, but not counting chicks. We're also still working on the query, just in case.
Now if only every agent had a blog like Ms. Reid's. But then, she is the top of the food chain. ;o]