I need to display the last time a school hosted the SAT exam as mm/dd/yy.

I have been fighting for two days to try to get the correct syntax

My code is:

<TD><%Response.Write Format(rsSchools("LastTestDate"), "mm/dd/yy")%></TD>

I get the message:

Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'Format'
/USExams/SatPageAct.ASP, line 169

What am I doing wrong?

Thanks in advance

Granny

Re: Format Date Syntax Problem by Michael

Michael
Sat Jan 27 17:41:23 CST 2007

> <TD><%Response.Write Format(rsSchools("LastTestDate"),
> "mm/dd/yy")%></TD>
>
> I get the message:
>
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch: 'Format'
> /USExams/SatPageAct.ASP, line 169
>
> What am I doing wrong?

Using a Format() function that does not exist in VBScript...

Download details: Windows Script Documentation
http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en

For server side ASP you are better off writing your own explicit date
formatting function. The FormatDateTime function in VBScript is sensitive
to regional settings, something generally out of the control of an ASP
author.

Can I make VBScript format dates for me?
http://classicasp.aspfaq.com/date-time-routines-manipulation/can-i-make-vbscript-format-dates-for-me.html

--
Michael Harris
Microsoft.MVP.Scripting