Custom Date Properties Are Set to Null Value

ID: Q240390


The information in this article applies to:
  • Microsoft Site Server version 3.0


SYMPTOMS

When you search on a date property derived from a meta tag, comparisons may not work and the value of the property may be blank.


CAUSE

For date properties, the date in the meta tag must be in a specific format. If it is not in the correct format, the value is not indexed and the property contains no data.


RESOLUTION

Make sure that the date is specified using one of the following formats:

  • Sun, 06 Nov 1994 08:49:37 GMT


  • Sunday, 06-Nov-94 08:49:37 GMT


  • Sun Nov 6 08:49:37 1994



  • MORE INFORMATION

    A meta tag that has been correctly formatted will look similar to the following:

    <meta name="customdate" content="Sun, 06 Nov 1994 08:49:37 GMT">
    Note that when you use Site Server Search to crawl a database, the date format returned from the database will not be in a format that Site Server Search recognizes. To have date values returned from the database crawl recognized by Site Server Search, modifications must be made to the Row.asp file generated by the Catalog wizard. The following is a sample Row.asp file that takes the LastModified column and formats it so that Search will recognize it as a date.
    
    <% Set r = createobject ("ADODB.Recordset.1.5") %>
    <% r.Open "SELECT LastModified, DocumentID, Title, Author, Body FROM Documents WHERE DocumentID = " & Request.QueryString("id"), "UID=sa;PWD=;DSN=News" %>
    <% Dim x() %>
    <% ReDim x(5) %>
    <% x(0) = r ("LastModified") %>
    <% x(1) = r ("DocumentID") %>
    <% x(2) = r ("Title") %>
    <% x(3) = r ("Author") %>
    <% x(4) = r ("Body") %>
    <HTML><HEAD><TITLE>
    <%
    Function Format_DBTYPE_DATETIME(value)
        If IsEmpty(value) OR IsNULL(Value) Then
            Format_DBTYPE_DATETIME = value
        Else
            fDAY = day(value)
            fMONTH = month(value)
            fYEAR = year(value)
            fHOUR = hour(value)
            fMINUTE = minute(value)
            fSECOND = second(value)
    
            select case (fMONTH)
                    case 1
                            fMONTHSTR = "Jan"
                    case 2
                            fMONTHSTR = "Feb"
                    case 3
                            fMONTHSTR = "Mar"
                    case 4
                            fMONTHSTR = "Apr"
                    case 5
                            fMONTHSTR = "May"
                    case 6
                            fMONTHSTR = "Jun"
                    case 7
                            fMONTHSTR = "Jul"
                    case 8
                            fMONTHSTR = "Aug"
                    case 9
                            fMONTHSTR = "Sep"
                    case 10
                            fMONTHSTR = "Oct"
                    case 11
                            fMONTHSTR = "Nov"
                    case 12
                            fMONTHSTR = "Dec"
            end select
    
            fDATE = fDAY & " " & fMONTHSTR & " " & fYEAR
            fTIME = fHOUR & ":" & fMINUTE & ":" & fSECOND
            fDATETIME = fDATE & " " & fTIME
            Format_DBTYPE_DATETIME = fDATETIME
        End if
    End Function
    %>
    
    <% y=VarType(x(2)) %>
    <% if y <> 0 And y <> 1 Then %>
    <% =server.htmlencode (x(2)) %>
    <% End if %>
    </TITLE>
    <% y=VarType(x(0)) %>
    <% if y <> 0 And y <> 1 Then %>
    <META NAME="LastModified" content="<% =server.htmlencode (Format_DBTYPE_DATETIME(x(0))) %>">
    <% End if %>
    <% y=VarType(x(1)) %>
    <% if y <> 0 And y <> 1 Then %>
    <META NAME="DocumentID" content="<% =server.htmlencode (x(1)) %>">
    <% End if %>
    <% y=VarType(x(3)) %>
    <% if y <> 0 And y <> 1 Then %>
    <META NAME="Author" content="<% =server.htmlencode (x(3)) %>">
    <% End if %>
    </HEAD><BODY>
    <% y=VarType(x(4)) %>
    <% if y <> 0 And y <> 1 Then %>
    <% =server.htmlencode (x(4)) %>
    <% End if %>
    </BODY></HTML> 

    Additional query words:

    Keywords :
    Version : winnt:3.0
    Platform : winnt
    Issue type : kbprb


    Last Reviewed: September 8, 1999
    © 2000 Microsoft Corporation. All rights reserved. Terms of Use.