Foxtable(狐表)用户栏目专家坐堂 → [求助] if语句中,like怎么用?


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

主题:[求助] if语句中,like怎么用?

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


加好友 发短信
等级:小狐 帖子:384 积分:2706 威望:0 精华:0 注册:2015/11/27 19:09:00
[求助] if语句中,like怎么用?  发帖心情 Post By:2020/10/31 16:41:00 [只看该作者]

If e.Table.Name = "统计"
    If e.Col.IsDate AndAlso e.Col.Name. like "%年度"  'AndAlso e.Row.IsNull(e.Col) Then
        'e.Text = Format(e.Row(e.Col), "yyyy年")
MessageBox.Show("年度")
    Else If e.Col.IsDate AndAlso e.Col.Name Like "%月份"  'AndAlso e.Row.IsNull(e.Col) Then
        'e.Text = Format(e.Row(e.Col), "yyyy年MM月")
MessageBox.Show("月份")
    Else If e.Col.IsDate AndAlso e.Col.Name Like "%日期"  'AndAlso e.Row.IsNull(e.Col) Then
        'e.Text = Format(e.Row(e.Col), "yyyyMMdd")
MessageBox.Show("日期")
    Else If e.Col.IsDate AndAlso e.Col.Name Like "%时间"  'AndAlso e.Row.IsNull(e.Col) Then
        'e.Text = Format(e.Row(e.Col), "yyyyMMdd HH:mm")
MessageBox.Show("时间")
    End If
End If

经过测试,e.Col.Name. like "%年度"   没有判断出来,不知道正确的应该怎么写?

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105473 积分:536350 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/10/31 17:15:00 [只看该作者]

If e.Col.IsDate AndAlso e.Col.Name like "*年度"


 回到顶部
帅哥哟,离线,有人找我吗?
5159518
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:384 积分:2706 威望:0 精华:0 注册:2015/11/27 19:09:00
  发帖心情 Post By:2020/10/31 19:40:00 [只看该作者]

以下是引用有点蓝在2020/10/31 17:15:00的发言:
If e.Col.IsDate AndAlso e.Col.Name like "*年度"


ok,谢谢,又搞定一个


 回到顶部