如何计算使用 VB.NET 完成的天数百分比?
数据读取器采用project_start
和project_finished
,存储Date()
在 SQL-Server-2012 中。
这是我尝试过的:
Dim StartDate As New Date(datareader("project_start"))
Dim FinishDate As New Date(datareader("project_finish"))
Dim Percentage As Date = Date.FromOADate(StartDate.DayOfYear) / Date.FromOADate(FinishDate.DayOfYear) / 100
但我得到这个错误:
Operator '/' is not defined for types 'Date' and 'Date'.