可以试试先把sql来的数据转到一个字符串,再把字符串给dt

解决方案 »

  1.   

    Viewlog.viewlog_date_time应该是"表名.字段名",但是我这边也报错。不知道为什么。
    关注up~~~~~
      

  2.   

    版本应该是一样的老的是现成的,人家写好的sorry,我没说清楚
      

  3.   

    哪位朋友crystal report用的比较熟,帮帮忙!!
      

  4.   

    我也遇到这个问题,就是怎样在报表中显示形如"8/3/2002 03:47:11"的DATATIME数据。
      

  5.   

    to chenyu5188(蓝色情调) 
       多谢兄弟帮忙upto kmcyz(阿成) 
       你那现在有环境吗?能试一下上面的代码吗?多谢!
      

  6.   

    这样试试:StringVar dt:=ToText({Viewlog.viewlog_date_time}); 
       
    if dt[6 to 6]<>"0" and dt[9 to 9]<>"0" then dt:=dt[6 to 8]+dt[9 to 10]+"/"+dt[1 to 4]+dt[11 to 19]
    else if dt[6 to 6]="0" and dt[9 to 9]<>"0" then dt:="  "+dt[7 to 8]+dt[9 to 10]+"/"+dt[1 to 4]+dt[11 to 19]
    else if dt[6 to 6]<>"0" and dt[9 to 9]="0" then dt:=dt[6 to 8]+"  "+dt[10 to 10]+"/"+dt[1 to 4]+dt[11 to 19]
    else if dt[6 to 6]="0" and dt[9 to 9]="0" then dt:="  "+dt[7 to 8]+"  "+dt[10 to 10]+"/"+dt[1 to 4]+dt[11 to 19];
    dt
      

  7.   

    to kmcyz(阿成)
    不行啊,check 是没有错误,可是运行起来报
    "A subscript must be 1 and the length of string"
      

  8.   

    A subscript must be 1 and the length of string
    这个错误可能是超出控件的索引值,比如listview控件如果引用或设置listitem或者subitem超出范围(比如只有5个subitem,而你要用第7个subitem)时,出这种错,我是猜测,仅提供参考。不知对你有用吗?
      

  9.   


    "" & 字段 
    的方式可以避免空值
      

  10.   

    不是空值的问题,我只选is not null的也报这个错呀