View Single Post

   
  #2 (permalink)  
Old 02-29-2008, 04:55 AM
me
 
Posts: n/a
Default Re: SQL Query Help-- Order By Clause

Just an idea that might work somehow don't know if its a good way to do it
or not but ...


order by
isnull(cast(datefieldname as varchar(20)),'Z') desc




"Muzamil" <muzamil@hotmail.com> wrote in message
news:5a998f78.0408120609.526d5bc4@posting.google.c om...
> Hi
>
> I want a simple select query on a column-name (smalldatetime) with
> values dislayed in desc order with null values FIRST.
>
> i.e.
>
> Select orderdate from orders
> order by ( null values first and then orderdate in desc order)
>
> could any one please help
>
> Thanks




Reply With Quote