Changing a column type in sql

  • Thread starter Thread starter Andy Levy
  • Start date Start date
A

Andy Levy

Hi

Is it possible to change the column data type in an sql statement

I have a table column which is set as text data type. It only contains
numbers, but fir various reasons it must be set to text.

My sql query has an order by statement at the end - which does not order it
numerically if the data type is text. So i want to change the data type on
the fly.

Thanks

AL
 
Try:
ORDER BY Val([NameOfYourTextFieldHere])

If the field contains Nulls, include Nz().
If whole numbers only, use CLng() instead of Val().
 
Back
Top