I would like to have the date 2/3/00 stored
as three variables....
2 = dayvar
3 = monthvar
00 = yearvar
how can I take that date (it will change
everytime.... )
Evan
Printable View
I would like to have the date 2/3/00 stored
as three variables....
2 = dayvar
3 = monthvar
00 = yearvar
how can I take that date (it will change
everytime.... )
Evan
How is the date given to you?
As a Date? ( DateValue("2/3/00") )
Or as a String? ( "2/3/00" )
If its as a date you can do the following :
If it is given to you as a string you can do :Code:Dim dtDate as Date
Dim dayvar as integer, monthvar as integer, yearvar as integer
dtDate = DateValue("2/3/00")
dayvar = day(dtDate)
monthvar = month(dtDate)
yearvar = year(dtDate)
Just in case you are not sure about it being a string or a date... Getting the value from a TextBox means it is a string... getting it from a field in a database where it is stored as a date means you get it as a date.Code:Dim cDate as String
Dim dtDate as Date
Dim dayvar as integer, monthvar as integer, yearvar as integer
dtDate = DateValue(cDate)
dayvar = day(dtDate)
monthvar = month(dtDate)
yearvar = year(dtDate)