LilolProgrammer
12-16-2008, 09:32 AM
hello everyone,
i've come across this issue in which i'm entering a date save it to a database and redisplay the date. in the same field box that you would enter your date...
well it saves to the database but not in the correct format (dd/yy/yymm)
if i write 11/01/08 it will show in the database as 01/08/2011... the text field auto dates the data as you enter it...
i have a function that will convert it properly but as soon as i apply it i get that runtime error stating that the string ive entered is a type mismatch...
CODE:
function for the date conversion
function dateConv4(varDate)
if day(varDate) < 10 then
dd = "0" & day(varDate)
else
dd = day(varDate)
end if
if month(varDate) < 10 then
mm = "0" & month(varDate)
else
mm = month(varDate)
end if
dateConv4 = year(varDate)& mm & dd
end function
thanks in advanced
i've come across this issue in which i'm entering a date save it to a database and redisplay the date. in the same field box that you would enter your date...
well it saves to the database but not in the correct format (dd/yy/yymm)
if i write 11/01/08 it will show in the database as 01/08/2011... the text field auto dates the data as you enter it...
i have a function that will convert it properly but as soon as i apply it i get that runtime error stating that the string ive entered is a type mismatch...
CODE:
function for the date conversion
function dateConv4(varDate)
if day(varDate) < 10 then
dd = "0" & day(varDate)
else
dd = day(varDate)
end if
if month(varDate) < 10 then
mm = "0" & month(varDate)
else
mm = month(varDate)
end if
dateConv4 = year(varDate)& mm & dd
end function
thanks in advanced