Hi, due to the different local setting (Date setting) around the world I have to manually create a standard date format for our online database system.(ASP) We prefer to use YYYY/MM/DD. But the hosting server is MM/DD/YYYY.
It works fine if I just want to print out the date
<td><%=ProjectDate%> </td>
but when I tried to do
<td><%=year(ProjectDate)&"/"&month(projectdate)&"/"&day(projectdate)%> </td>
it gives me the following error message
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/ZAO/App/Project/Invoice.asp, line 204
However I can do the following script without a problem
today=year(date())&"/"&month(date())&"/"&day(date())
I have no idea what I did wrong. I have even tried to use Cdate().
the following code works fine
<td><%=Cdate(ProjectDate)%> </td>
however when I add year(), it gives me the same error. (I test it with Year() only this time)
<td><%=Year(Cdate(ProjectDate))%> </td>
What's wrong with my code? (I think this should be a very simple command) or is there a better way to use a standard date format without doing all these complicated manual format.
Thanks in advance
It works fine if I just want to print out the date
<td><%=ProjectDate%> </td>
but when I tried to do
<td><%=year(ProjectDate)&"/"&month(projectdate)&"/"&day(projectdate)%> </td>
it gives me the following error message
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/ZAO/App/Project/Invoice.asp, line 204
However I can do the following script without a problem
today=year(date())&"/"&month(date())&"/"&day(date())
I have no idea what I did wrong. I have even tried to use Cdate().
the following code works fine
<td><%=Cdate(ProjectDate)%> </td>
however when I add year(), it gives me the same error. (I test it with Year() only this time)
<td><%=Year(Cdate(ProjectDate))%> </td>
What's wrong with my code? (I think this should be a very simple command) or is there a better way to use a standard date format without doing all these complicated manual format.
Thanks in advance