473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

FormatDateTime error in MysQL

This is an asp page which adds a template to a mysql database. it returns this error




Microsoft VBScript runtime error '800a000d'

Type mismatch: 'FormatDateTime'


/temps.asp, line 111

and the code in line 111 is


Expand|Select|Wrap|Line Numbers
  1. <td align="center" title="Created on <%=FormatDateTime(sDATE,1)%>"><%=sDATE%></td>

more code from the page concerened


Expand|Select|Wrap|Line Numbers
  1. SQL = "SELECT ID, fldNAME, fldDATE FROM nm_tbl_template ORDER BY " & ORD
  2.     Call OPEN_DB()
  3.     Set RS = Server.CreateObject("ADODB.Recordset")
  4.     RS.LockType   = 1
  5.     RS.CursorType = 0
  6.     RS.Open SQL, MyConn    
  7.         IF NOT RS.EOF THEN
  8.             strRETURNED_DATA = RS.getrows
  9.         ELSE
  10.             EOF_VAL = True
  11.         END IF    
  12.     RS.close
  13.     Set RS = Nothing
  14.     MyConn.close            
  15.     Set MyConn = Nothing    
  16.  
  17.     IF Not EOF_VAL = True Then
  18.         intNUM_COL=ubound(strRETURNED_DATA,1)
  19.         intNUM_ROW=ubound(strRETURNED_DATA,2)
  20.         FOR intROW_COUNTER = 0 TO intNUM_ROW
  21.             ID     = strRETURNED_DATA(0,intROW_COUNTER)
  22.             NAME   = strRETURNED_DATA(1,intROW_COUNTER)
  23.             sDATE  = strRETURNED_DATA(2,intROW_COUNTER)
  24.             %>
  25.             <tr onMouseOver="bgColor='WhiteSmoke'" onMouseOut="bgColor='White'">
  26.                 <td align="Center" width="30">
  27.                     <table cellpadding="2" cellspacing="0" border="0" width="30">
  28.                         <tr>
  29.                             <td><% IF Trim(arrLEVEL(17)) = "1" THEN %><a href='template_edit.asp?ID=<%=ID%>'><img src="Images/ico_edit.gif" width="15" height="15" alt="Edit Template" border="0"></a><%Else%>&nbsp;<%End If%></td>
  30.                             <td><% IF Trim(arrLEVEL(18)) = "1" THEN %><%IF IsMSIE = True THEN%><a style="cursor:pointer;cursor:hand;" onclick="DeleteTemplate('<%= ID %>','<%= FIX_JS_STR(NAME) %>')"><%Else%><a href='template_del.asp?ID=<%=ID%>'><%End If%><img name="image<%=ID%>" src="Images/ico_del.gif" width="15" height="15" alt="Delete" border="0" onMouseOver="image<%=ID%>.src='Images/ico_del_on.gif';" onMouseOut="image<%=ID%>.src='Images/ico_del.gif';" /></a><% Else%>&nbsp;<% End If %></td>
  31.                         </tr>
  32.                     </table>
  33.                 </td>
  34.                 <td width="39" align="Center"><%=ID%></td>
  35.                 <td style="cursor:pointer;cursor:hand;" onClick="window.location='template_view.asp?ID=<%=ID%>'"><%=NAME%></td>
  36.                 <td align="center" title="Created on <%=FormatDateTime(sDATE,1)%>"><%=sDATE%></td>
  37.                 <td width="15"><a href="news_add.asp?TID=<%=ID%>"><img src="images/template.gif" width="15" height="15" alt="Apply Template" border="0"></a></td>
  38.                 <td width="15"><a href='template_view.asp?ID=<%=ID%>'><img src="images/view_zoom.gif" width="15" height="15" alt="Preview Template" border="0"></a></td>
  39.             </tr>            
  40.             <%
  41.         NEXT
  42.     ELSE
  43.         %>    
  44.         <tr><td colspan="4">No template has been found.</td></tr>
  45.         <%
  46.     END IF       
  47.     %>     
can anyone tell offhand what is wrong with the particular line or code? or what i could try to get rid of the error?
Nov 17 '08 #1
1 3520
ive got the solution now,

Expand|Select|Wrap|Line Numbers
  1. <%
  2.      dt = strRETURNED_DATA(2,intROW_COUNTER)
  3.      If IsDate(dt) Then 
  4.          dt = FormatDateTime(CDate(dt))
  5.      Else
  6.          dt = "N/A" ' or whatever
  7.      End If
  8. %>
  9. <td align="center" title="Created on <%=dt%>"><%=dt%></td>
  10. ...
Nov 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
0
by: Ola Ogunneye | last post by:
--=_075912CF.F899D547 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello again all, I have created an account in the particular database that I was trying to...
0
by: Morten Gulbrandsen | last post by:
C:\mysql\bin>mysql -u elmasri -pnavathe company Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 to server version: 4.1.0-alpha-max-debug Type...
0
by: Morten Gulbrandsen | last post by:
mysql> USE company; Database changed mysql> mysql> DROP TABLE IF EXISTS EMPLOYEE; -------------- DROP TABLE IF EXISTS EMPLOYEE -------------- Query OK, 0 rows affected (0.00 sec)
4
by: Sune | last post by:
Hi, Is there any way to define the default date/time format, instead of having to format every single time you print a date/time? Thanks -- Regards, Sune
1
by: jiing | last post by:
Now let me describe what I have done and my purpose: Originally, I want to user ports to install phpBB But I found that phpBB doesn't support mysql 5.x (but the ports installed mySQL 5.0.0...
10
by: John K | last post by:
I recently took a job doing PHP but come from an ASP background. I'm trying to find a conversion equivalent for VBScript's "formatdatetime". All I want to do is convert a MySQL datetime field...
5
by: John K | last post by:
I posted on this a week or so ago and found a resolution in that instance by using DATE_FORMAT in my sql string to display the format I was looking for. This time I need to format the date going...
2
by: fiefie.niles | last post by:
I set my computer Regional Setting (Control Panel - Regional and Language Options - Customize - Date) to dd/mm/yy. In my ASP page I do the following: FormatDateTime("1/20/07",2) and it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.