ODBiC Discussion Board


RE: Converting number in a text field to a numeric number, Scott S, 02-17-2005

Use an ORDER BY clause with a conversion function

by Roger Harris, February 26, 2005 11:10

The text field needs to be converted to numeric data to get the proper sorting order. MS-Access lets you use standard Visual Basic functions in SQL statements, so you can use "... ORDER BY Int(column)" or "... ORDER BY Val(column)" to sort by the converted numeric value (integer or floating point, respectively). But other databases will probably not support those functions. Most databases support a Convert( ) function that will allow you to do the numeric conversion, but unfortunately they all implement the Convert( ) differently, so you'll need to check the documentation for the specific database to determine the calling parameters.


Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.