以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  请教日期类型如何转字符串  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=145103)

--  作者:weipeng6999
--  发布时间:2020/1/8 15:01:00
--  请教日期类型如何转字符串

老师好!再次请教

 

   

Dim StartDate As Date = Date.Today

Dim rw As WinForm.TopicBar = e.Form.Controls("任务栏")
Dim ndbg As WinForm.TopicLink = rw.Pages("提醒").Links("报告")
Dim wt As WinForm.TopicLink = rw.Pages("提醒").Links("期限")
ndbg.Text = "到期的报告 共有 " & DataTables("客户信息表").Compute("count(_identify)","substring(报告,1,4) < " &  StartDate.Year & "")
wt.Text = "到期的委托采购期限 共有 " & DataTables("客户信息表").Compute("count(_identify)","substring(期限,1,4) < " &  StartDate.Year & "")

 

报告字段是字符串类型,正常。期限为日期类型,

wt.Text = "到期的委托采购期限 共有 " & DataTables("客户信息表").Compute("count(_identify)","substring(期限,1,4) < " &  StartDate.Year & "") 应该怎么样转换一下


--  作者:有点蓝
--  发布时间:2020/1/8 15:09:00
--  
.Compute("count(_identify)","substring(convert(期限,\'System.String\'),1,4) < " &  StartDate.Year & "")