QoQ Cast Order By

2011-08-21 Thread Richard White

Hi

is there a way to use the cast function in the order by clause, e.g:

Select x from query
order by cast(x as date)

it shows an error saying cast cannot be used. Does anyone know a way around it?

thanks 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346893
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: QoQ Cast Order By

2011-08-21 Thread Raymond Camden

Try

select cast(x as y)
from query
order by y


On Sun, Aug 21, 2011 at 8:45 AM, Richard White rich...@j7is.co.uk wrote:

 Hi

 is there a way to use the cast function in the order by clause, e.g:

 Select x from query
 order by cast(x as date)

 it shows an error saying cast cannot be used. Does anyone know a way around 
 it?

 thanks

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346896
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: QoQ Cast Order By

2011-08-21 Thread Richard White

thanks ray!

Try

select cast(x as y)
from query
order by y



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346898
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm