Microsoft KB Archive/240390

= Custom Date Properties Are Set to Null Value =

Article ID: 240390

Article Last Modified on 10/30/2003

-

APPLIES TO


 * Microsoft Site Server 3.0 Standard Edition

-



This article was previously published under Q240390



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 GMTSunday, 06-Nov-94 08:49:37 GMTSun Nov 6 08:49:37 1994



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



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= ;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") %>  <% 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 %>  <% y=VarType(x(0)) %> <% if y <> 0 And y <> 1 Then %> "> <% End if %> <% y=VarType(x(1)) %> <% if y <> 0 And y <> 1 Then %> "> <% End if %> <% y=VarType(x(3)) %> <% if y <> 0 And y <> 1 Then %> "> <% End if %>  <% y=VarType(x(4)) %> <% if y <> 0 And y <> 1 Then %> <% =server.htmlencode (x(4)) %> <% End if %> </HTML>

Keywords: kbprb kbpending KB240390

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.