>hi
>Borislav
>
>i have created table table1 with bill_no varchar(10)
>insert records as under
>1111AAAA
>23000AAA
>AAAA1111
>22222
>
>I Want to get max 23000 only
>
>i have get max value in vpf like
>select max(val(bill_no)) as bill_no FROM TABLE1
>But i have comes problem in sql2000
This would be problem not only on SQL2000, all versions will raise that error. SQL Server can't convert varchar (or any other char types) if they contain non digit symbols. You could use CHRTRAN() UDF to remove all non digit chars and then convert it to integer. UDF functions created by Igor Nikiforov you could find here - Download #
29527
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.