select ISNUMERIC('0000000000000000000000001111111111111111111111111111111111111111111111111111111')

解决方案 »

  1.   

    ISNUMERIC
    決定運算式是否為有效的數值型別。語法
    ISNUMERIC ( expression )引數
    expression是要驗算的運算式。傳回型別
    int備註
    當輸入運算式驗算為有效整數、浮點數字、money 或 decimal 型別時,ISNUMERIC 會傳回 1,否則會傳回 0。傳回值為 1 確保 expression 可被轉換成這些數值型別之一。範例
    A. Use ISNUMERIC
    此範例傳回 1,因為 zip 資料行包含有效的數字值。 USE pubs
    SELECT ISNUMERIC(zip) 
    FROM authors
    GOB. 使用 ISNUMERIC 與 SUBSTRING
    此範例傳回 0 給在 titles 資料表中的所有標題,因為沒有標題是有效的數字值。USE pubs
    GO
    -- Because the title column is all character data, expect a result of 0
    -- for the ISNUMERIC function.
    SELECT SUBSTRING(title, 1, 15) type, price, ISNUMERIC(title)
    FROM titles
    GO以下為結果集:type            price                                  
    --------------- -------------------------- ----------- 
    The Busy Execut 19.99                      0           
    Cooking with Co 11.95                      0           
    You Can Combat  2.99                       0           
    Straight Talk A 19.99                      0           
    Silicon Valley  19.99                      0           
    The Gourmet Mic 2.99                       0           
    The Psychology  (null)                     0           
    But Is It User  22.95                      0           
    Secrets of Sili 20.00                      0           
    Net Etiquette   (null)                     0           
    Computer Phobic 21.59                      0           
    Is Anger the En 10.95                      0           
    Life Without Fe 7.00                       0           
    Prolonged Data  19.99                      0           
    Emotional Secur 7.99                       0           
    Onions, Leeks,  20.95                      0           
    Fifty Years in  11.95                      0           
    Sushi, Anyone?  14.99                      0           
      

  2.   

    如故要判斷有多少個數字,用char()函數對它的ASCII碼作判斷
      

  3.   

    if isnumeric(字符)=1 
       print('是数字')
    else
       if isnumeric(字符)=0
          print('非数字')
      

  4.   

    楼上再加第2个if是不是多余了?if isnumeric(字符)=1 
       print('是数字')
    else
       print('非数字')
      

  5.   

    如果
    isnumeric($1,2)=1
    isnumeric(1,23)=1
    那就和我设想的有差异,我的设想是可以convert(int,'XXXXX')才算数字,不知可否?谢谢!
     
      

  6.   

    isnumeric这个若要判断是整型的话就不行了~~~如: if isnumeric(127.5)=1 then print '是数字'这样试试:
    if 'XXXX' like '[1-9][0-9][0-9][0-9]'
     print '是整型数字'
    else
     print '不是整型数字'
      

  7.   

    isnumeric($1,2)=1
    是什么意思啊?
      

  8.   


    function checkNum(str)
    dim str1,str2str1=Array(0,1,2,3,4,5,6,7,8,9)''''str2是待检测的str2=strif isnumeric(str2) then
        checkNum=false
        exit function
    end ifif len(replace(str2,".",""))>1 then
        checkNum=false
        exit function
    else
        str2=replace(str2,".","")
    end iffor i=0 to len(str2)    for j=0 to ubound(str1)
            if mid(str2,i,i+1)<>str(j) then
                checkNum=false
                exit function
            end if
        nextnextcheckNum=trueend function代码写的垃圾,不过应该不会漏了吧!