Leeus
01-13-2003, 03:25 PM
I created the following function
Function sqldate(dateinput)
dim finaloutput,dayval,monval,yearval,textmon
dayval = day(dateinput)
monval = month(dateinput)
yearval = year(dateinput)
finaloutput = dayval & "-" & textmon & "-" & yearval
select case monval
case "1"
textmon= "JAN"
case "2"
textmon= "FEB"
case "3"
textmon= "MAR"
case "4"
textmon= "APR"
case "5"
textmon= "MAY"
case "6"
textmon= "JUN"
case "7"
textmon= "JUL"
case "8"
textmon= "AUG"
case "9"
textmon= "SEP"
case "10"
textmon= "OCT"
case "11"
textmon= "NOV"
case "12"
textmon= "DEC"
end select
finaloutput = dayval & "-" & textmon & "-" & yearval
'response.write(finaloutput)
end function
It works fine if I keep the response.write in but what I want to achieve is e.g. datevar= sqldate(date()) then response.write(datevar), this doesn't seem to work though, any ideas?
Function sqldate(dateinput)
dim finaloutput,dayval,monval,yearval,textmon
dayval = day(dateinput)
monval = month(dateinput)
yearval = year(dateinput)
finaloutput = dayval & "-" & textmon & "-" & yearval
select case monval
case "1"
textmon= "JAN"
case "2"
textmon= "FEB"
case "3"
textmon= "MAR"
case "4"
textmon= "APR"
case "5"
textmon= "MAY"
case "6"
textmon= "JUN"
case "7"
textmon= "JUL"
case "8"
textmon= "AUG"
case "9"
textmon= "SEP"
case "10"
textmon= "OCT"
case "11"
textmon= "NOV"
case "12"
textmon= "DEC"
end select
finaloutput = dayval & "-" & textmon & "-" & yearval
'response.write(finaloutput)
end function
It works fine if I keep the response.write in but what I want to achieve is e.g. datevar= sqldate(date()) then response.write(datevar), this doesn't seem to work though, any ideas?