select * from Student where StudentNO Like 'STNO%'
AND ISNUMERIC (SUBSTRING(StudentNO,4,5))

解决方案 »

  1.   

    有点小错误:改为;
    select * from Student where StudentNO Like 'STNO%' AND ISNUMERIC(SUBSTRING(StudentNO,4,5))=1
      

  2.   

    你的问题不对,照你的说法,根本取不出记录来,第四位是已经是o了,那4-8位怎么又可能是数字呢?我想应该是5-8位为数字:改为:
    select * from Student where StudentNO Like 'STNO%' AND ISNUMERIC(SUBSTRING(StudentNO,5,4))=1
      

  3.   

    好象问题本身就有问题啊!
    select * from Student where StudentNO Like 'STNO%' AND ISNUMERIC(SUBSTRING(StudentNO,5,4))=1
    应该可以了,
    你试一下了!
      

  4.   


    同意 netcoder(朱二) ,楼主的问题肯定自相矛盾
      

  5.   


    --如果是查询 StudentNO字段LIKE 'STNO%',且 5-8 位为数字,可以这样写:--这样一个条件就可以出来了:select * from 表
    where StudentNO LIKE 'STNO[0-9][0-9][0-9][0-9]%'
      

  6.   

    --那就是这样查询(不知道你那个LIKE 'STNO%'的条件是否还要,如果要,就加上) :select * from 表
    where isnumeric(stuff(StudentNO,1,4,''))=1
      

  7.   

    同意zhucde的,把按钮设为OwnerDraw类型,重载DrawItem或添加自绘按钮类的CTLCOLOR消息响应,而不是对话框类的OnCtlColor。