[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

[no subject]



If you want a correct order, why not use and order by
clasue?

Select to_char(b.end_dt, 'MM/DD/YYYY')
from table b
order by b.end_dt ! if end_dt is a datetime column,
else do order by to_date(end_dt)


Arjan



--- Heather Missel <hmissel@ROCHESTER.RR.COM> wrote:
> I am having a problem building a list box that
> contains calendar end dates in the correct order.
>
> I build the SQL view as:
>
> Select to_char(b.end_dt, 'MM/DD/YYYY')      !Need
> this format
> from ps_deptid_tbl
>
> The returned values are in alpha order, and I need
> them in date order.
>
> I have also tried to_date(to_char(b.end_dt,
> 'MM/DD/YYYY))
> from ps_deptid_tbl
>
> This returns a SQL error "not a valid month"
>
> Any help would be greatly appreciated
>
> Dennis
>


__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/