怎样转换为data型数据

urbanboy 2002-05-10 03:09:25
dim year as integer
dim month as integer
dim day as integer
dim chargetime as data
怎样将year,month,day转换为chargetime呀?
...全文
39 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzgff 2002-05-10
  • 打赏
  • 举报
回复
chargetime = CDate (year & "-" & month & "-" & "day")
bigbigfans 2002-05-10
  • 打赏
  • 举报
回复
DateSerial
DateSerial(2002,4,31)=#2002-5-1#
thinkeasy 2002-05-10
  • 打赏
  • 举报
回复
dim year as integer
dim month as integer
dim day as integer
dim chargetime as date
chargetime=DateSerial(year,month,day)
urbanboy 2002-05-10
  • 打赏
  • 举报
回复
它怎么说 mydate=format(str,"yy-mm-dd")中变量未设置?
zhujiechang 2002-05-10
  • 打赏
  • 举报
回复
dim year as integer
dim month as integer
dim day as integer
dim chargetime as date
dim Str as string

str=year & "-" & month & "-" & day
chargetime=cdate(str)
footballboy 2002-05-10
  • 打赏
  • 举报
回复
日期型是Date 不是data
softrain 2002-05-10
  • 打赏
  • 举报
回复
Dim year As Integer
Dim month As Integer
Dim day As Integer
Dim str As String
Dim mydate As Date
year = 1999
month = 3
day = 23
str = CStr(year) & "-" & CStr(month) & "-" & CStr(day)
mydate = Format(str, "yy-mm-dd")
MsgBox mydate

7,787

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧