CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Microsoft VBScript runtime error '800a000d' Type mismatch: 'FormatDateTime'

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    7
  • Date Created
    Sunday, September 26, 2010
  • Last Updated
    Monday, April 10, 2017
  • This Article Has been Viewed
    4648 times
  • Short Desc
    When retrieving data back from your database when using a function you may receive this error if the record is blank (or) if you have misspelled your Function name.
  • Details
    Using the following code:
    <%
    =FormatDateTime(RevDate,vblongdate)
    %>

    You may get the following error if the field is blank.

     
    Microsoft VBScript runtime error '800a000d'
    Type mismatch: 'FormatDateTime'
    /kb/kbarticle.asp, line 91
  • Recreate Issue
    To recreate this error, run the following code against your database with a blank field, in this case, we are working with a Data Type: DateTime

    <%
    =FormatDateTime(RevDate,vblongdate)
    %>


    The FormatDateTime function converts the datetime to a specific format other than its original.

    Scenario #2:
    Make sure that you spell your Function correctly.
    You create a Function called: Function ReverseSQL()
    And you spell it as: ReveseSQL()

    Example
    <%
    =ReveseSQL(myRecord)
    %>


    Scenario #3:
    When hardcoding the a date, you might incorrectly write out the date wrong.
    Example: 2\19\2011
  • Resolve Issue
    Make sure that you have a data in your datetime field.
    9/29/2010
    Then run it against the function
    <%
    =FormatDateTime(RevDate,vblongdate)
    %>

    Against your database.

    Scenario #2:
    You Function is: Function ReverseSQL()
    To correctly write out your Function with your variable
    <%
    =ReverseSQL(myRecord)
    %>


    Make sure that it is spelled correctly.

    Scenario #3:
    Make sure that if you are passing a date value that is hardcoded in the page, that it is properly written out.
    Example: 2/19/2011

    Scenario #4
    We have a date like this 2017-04-10T16:00:09+00:00
    We need to get the date part, so we use the following

    theDate = "2017-04-10T16:00:09+00:00"
    FormatDateTime(theDate)


    This is not going to work, as it is not able to get the date from the string.
    next, we need to remove everything from the 10th character on.
    We just want the date: 2017-04-10
    left(theDate,10)
    The above code, will remove everything from the right of the 10th character.
    And give us just the date: 2017-04-10
    Now, we can convert it with.
    FormatDateTime(left(theDate,10),1)
    Which will give us.
    Monday, April 10, 2017