How to sort date based on Today

How to sort date based on Today

am 13.04.2006 04:23:24 von Don Hobson

I need to sort my job postings from today to the past, but my date sort
basically sorts dates from January to December. How do I get the sort to
start from the today's date back

SELECT jobs.id, jobs.jobtitle, jobs.companyname, jobs.zipcodeId,
jobs.neighborhoodId, neighborhood.name, jobs.created FROM jobs, neighborhood
WHERE jobs.neighborhoodId = neighborhood.id ORDER BY created DESC

Lets say today is April 12th.

I store the dates in mysql as epoch dates (1165963600)
My sort incorrectly shows like this descending

Dec 12 - 1165963600
Aug 19
Aug 19
Jul 08
Jul 08
Jun 05
Apr 12
Apr 12
Apr 12


I want it to show like this for

Apr 12
Apr 12
Apr 12

Dec 12
Aug 19
Aug 19
Jul 08
Jul 08
Jun 05

Re: How to sort date based on Today

am 20.04.2006 11:21:17 von richard.a.fletcher

Does this help? (I tend to use postgresql so now() may be something
like today() or whatever).

select case when created-now()<86400 then 1 else 0 end as priority from
jobs .... order by priority desc, created desc.

Re: How to sort date based on Today

am 20.04.2006 19:52:33 von unknown

Post removed (X-No-Archive: yes)