KnowYourPhrase.com - The Meanings and History For Popular Idioms and Phrases | Use this handy list of phrases to search for more!
The origins of this phrase are unclear. It is said that Thomas More used a variant form of this expression in the year 1532:
"To go looking for a needle in a meadow."
The phrase, with the wording that it has today, is in writing as early as the 1830s. For example, it was written in a book titled The Complete Works of Washington Irving, published in the year 1834:
"If I want to find any particular article, it is, in the language of an humble but expressive saying, -- 'looking
for a needle in a haystack.' "
Since the phrase in the quote above is being referred to as a "humble but expressive saying," then it must already be a known expression at that time, and is thus older. However, the quote above is the earliest that I could find of the expression with its current wording.
* Dennis is looking for a cheaper apartment that's in a better location than his current one, but so far it's like looking for a needle in a haystack.
Note: The origins for many common idioms are unclear. In cases like this, a theory might be listed on the phrase's page that is about how a phrase may have originated. If no theory is listed, then I might simply try to find the earliest quote of a phrase being used and post that on the page. These quotes are to give you an idea for at least how old an expression is. So, for example, if a newspaper from the year 1801 uses an expression and I quote it, then you know the it's at least that old.