【发布时间】:2015-08-07 17:27:03
【问题描述】:
我正在尝试在 SQL 数据库中查询日期在用户输入给定日期之后的所有行。当我用“#”包围我的日期时,我遇到了从“附近语法不正确”到“将表达式转换为算术溢出错误”的各种错误。我当前的代码如下所示:
inputdate = InputBox("Please enter the starting date (mm/dd/yyyy)")
Debug.Print inputdate
querydate = "(DTG > " & Format(inputdate, "MMDDYYYY") & ")"
select StationID, DTG, CeilingFeet from SurfaceOb where " & querydate & " and StationID = 'NZWD'"
DTG 是 SQL 数据库中日期时间组的列名。知道我哪里出错了吗?在过去的几天里,我已经尝试了所有能找到的解决方案,但都没有运气。提前谢谢你。
【问题讨论】: