Foxtable(狐表)用户栏目专家坐堂 → 狐表年龄计算


  共有31638人关注过本帖树形打印复制链接

主题:狐表年龄计算

帅哥哟,离线,有人找我吗?
ybil
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:521 积分:4910 威望:0 精华:7 注册:2008/9/2 22:22:00
  发帖心情 Post By:2008/9/4 5:06:00 [显示全部帖子]

1,修改前的代碼:
If e.DataCol.Name = "出生日期" Then
   
   If e.dataRow.ISNull("出生日期") Then

       e.Datarow("年?") = nothing
 
    Else

        e.dataRow("年?") = Date.Today.Year  - e.dataRow("出生日期").Year

    End If

End If


2,修改後代碼:

If e.DataCol.Name = "出生日期" Then
   
   If e.dataRow.ISNull("出生日期") Then

       e.Datarow("年齡") = nothing
 
    Else

        e.dataRow("年齡") = Date.Today.Year  - e.dataRow("出生日期").Year

    End If

End If

3,輸入一行"出生日期"

4,如下圖所示:


图片点击可在新窗口打开查看此主题相关图片如下:110.jpg
图片点击可在新窗口打开查看

 回到顶部