标题:根据车辆上的有效日期, 判断若是与当前日期相差30天,则提示预警(方法中保 ...
只看楼主
黄某某某人
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2018-4-25
 问题点数:0 回复次数:1 
根据车辆上的有效日期, 判断若是与当前日期相差30天,则提示预警(方法中保留此判断,预警方式目前未定); 超过有效日期,则自动将有效标志变为 N;
    Public Function DecideVehicle() As Boolean
        Dim bResult As Boolean = False

        Dim oMT As New AWSvcMain.MTVehicle
        Dim strOrderSQL As String = ""
        strOrderSQL = "select MTVehicle.VehicleNo,* from MTVehicle  where datediff(dd,EffectiveDate,getdate())=30"
        Dim rs As ADODB.Recordset = G_objService.DB_ExecSelectSQL(strOrderSQL)
        If rs.EOF = False Then
            oMT.SetService(G_objService)
            Dim strKey As String
            Dim strSQL As String = ""
            strSQL = "select * from MTVehicle where datediff(dd,EffectiveDate,getdate())>30"
            Dim rs1 As ADODB.Recordset = G_objService.DB_ExecSelectSQL(strSQL)
            Do Until rs1.EOF = True
                strKey = rs1.Fields(0).Value
                If oMT.LoadFromDB(strKey) = True Then
                    oMT.ValidFlag = 0
                    If oMT.SaveToDB() = True Then
                        bResult = True
                    End If
                End If
                rs1.MoveNext()
            Loop
        End If

        Return bResult
    End Function
搜索更多相关主题的帖子: 日期 判断 Dim If End 
2018-04-25 17:44
黄某某某人
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2018-4-25
得分:0 
EffectiveDate 代表有效标志,MTVehicle是表。

[此贴子已经被作者于2018-4-25 17:48编辑过]

2018-04-25 17:44



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-486379-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.327256 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved