谢谢!

解决方案 »

  1.   

    isnull(时间字段,null)
    isnull(时间字段,'')
      

  2.   


    select case datefield is null then '' else convert(varchar(10),datefield,120) end
      

  3.   

    case when 日期字段='1900-01-01' then '' end
    --在前台應該好處理的吧
      

  4.   


    显示为1900...是因为日期字段为'',这样试试:
    declare @t table(s datetime)
    insert into @t select getdate()
    insert into @t select null
    insert into @t select ''select s=nullif(s,'') from @t
      

  5.   

    我的怎么就显示的空啊 我环境是 vs2003 用的datagrid 显示的
      

  6.   

    SELECT ISNULL(CONVERT(VARCHAR(10),列,120),'')
      

  7.   

    1、如果数据是1900-01-01格式,那么就用case when 条件去替换
    2  如果是null,那么查询语句就将时间字段查询时转换为字符串类型,上面有几个人就是这么做的
       select convert(char(10),时间字段,121),..... from table_Pqs where ............
      

  8.   

    因为数据绑定,获取了dateset有数据类型。
    将查询转为字符串类型到前台显示就不会象时间类型那样null初始化为起始的0值(也就是19000101)了