Custom query object with Simple-Fields custom date field

As Milo says, Simple Fields currently stores the dates in a much non preferred way.

I can think of two ways to solve this right now:

One: Fetch the posts “manually” using sql and use mysql function substr to re-make the dates to a valid format that you can sort on. A bit cumbersome, but would work.

The SQL query would look something like:

SELECT 
post_id,
DATE_FORMAT(concat(substr(_your_date_meta_key, 7, 4), "-",substr(_your_date_meta_key, 4,     2),"-",substr(_your_date_meta_key, 1, 2)), '%Y %b %D') as theDate
from wp_postmeta
where meta_key = "_your_date_meta_key"
order by theDate

And you would get the post ids in return, and then you can fetch just those ids using get_post() or similar.

Two: Fetch all posts using wp_query (as you already done) and then sort them in PHP using usort(). Depending on how many posts you have this could work pretty well.

(Three: Wait a couple of days and let me update Simple Fields with support for storing the dates as unixdates, since it makes so much more sense!)