选择题
设有如下变量声明:Dim TestDate As Date,为变量TestDate正确赋值的表达式是
。
A、
TestDate=#1/1/2007#
B、
TestDate#'1/1/2007'#
C、
TestDate=date('1/1/2002')
D、
TestDate=Format('m/d/yy'.'1/1/2002')
【正确答案】
A
【答案解析】
使用日期型数据常量时需要用“#”括起。Date函数不能带参数。Format函数将字符串转换为日期形式的格式是Format(expression[,format]-[,firstofweek[,firstweekofyear]])。
提交答案
关闭