分别要读取他们的年,,,月,,,日
应该怎么读啊
7 个解决方案
#1
Dim strDate,strYear,strMon,strDay
str = formatdatetime("1982-12-28")
strYear = Year(str)
strMon = Month(str)
strDay = Day(str)
str = formatdatetime("1982-12-28")
strYear = Year(str)
strMon = Month(str)
strDay = Day(str)
#2
支持楼上的
#3
up
#4
mydate="1982-12-28"
myYear=year(mydate)
myMonth=month(mydate)
myday=day(mydate)
'直接调用函数即可
myYear=year(mydate)
myMonth=month(mydate)
myday=day(mydate)
'直接调用函数即可
#5
从数据库中读出年 月 日(datestr)
select year(datestr),month(datestr),day(datestr) from table
select year(datestr),month(datestr),day(datestr) from table
#6
数据库中本来就是日期型的,那最好做了:
Dim strYear,strMon,strDay
strYear = Year(“1982-12-28 ”)
strMon = Month(“1982-12-28 ”)
strDay = Day(“1982-12-28 ”)
Dim strYear,strMon,strDay
strYear = Year(“1982-12-28 ”)
strMon = Month(“1982-12-28 ”)
strDay = Day(“1982-12-28 ”)
#7
也能用Split啊:)
DateStr = Split("1982-12-28","-")
DateStr(0)'年
DateStr(1)'月
DateStr(2)'日
DateStr = Split("1982-12-28","-")
DateStr(0)'年
DateStr(1)'月
DateStr(2)'日
#1
Dim strDate,strYear,strMon,strDay
str = formatdatetime("1982-12-28")
strYear = Year(str)
strMon = Month(str)
strDay = Day(str)
str = formatdatetime("1982-12-28")
strYear = Year(str)
strMon = Month(str)
strDay = Day(str)
#2
支持楼上的
#3
up
#4
mydate="1982-12-28"
myYear=year(mydate)
myMonth=month(mydate)
myday=day(mydate)
'直接调用函数即可
myYear=year(mydate)
myMonth=month(mydate)
myday=day(mydate)
'直接调用函数即可
#5
从数据库中读出年 月 日(datestr)
select year(datestr),month(datestr),day(datestr) from table
select year(datestr),month(datestr),day(datestr) from table
#6
数据库中本来就是日期型的,那最好做了:
Dim strYear,strMon,strDay
strYear = Year(“1982-12-28 ”)
strMon = Month(“1982-12-28 ”)
strDay = Day(“1982-12-28 ”)
Dim strYear,strMon,strDay
strYear = Year(“1982-12-28 ”)
strMon = Month(“1982-12-28 ”)
strDay = Day(“1982-12-28 ”)
#7
也能用Split啊:)
DateStr = Split("1982-12-28","-")
DateStr(0)'年
DateStr(1)'月
DateStr(2)'日
DateStr = Split("1982-12-28","-")
DateStr(0)'年
DateStr(1)'月
DateStr(2)'日