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().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top