|
So what is the problem? The
issue arises because the text
input box is sending it's data
in "text" format and the
database wants date/time. There
is no conversion taking place.
Here is what needs to happen to
make the conversion; when
inserting the date you want to
search for in the text box, you
surround the date with pound
signs: #12/1/2000#. This
converts the data type into
date/time. Obviously, you don't
want to make your users do this
so the example below shows you
how to edit this into the
FrontPage generated code so that
the conversion takes place
behind the scenes:
First, create your page with the
database results region and a
text search box that you want to
use to search against a
date/time field in your
database.
Second, you will modify the code
in HTML view. Look for a section
of code similar to the code
below, FrontPage should display
this code as grey:
<!--webbot bot="DatabaseRegionStart"
startspan
s-columnnames="EmployeeID,LastName,FirstName,Title,TitleOfCourtesy,BirthDate
,Hi
ireDate,Address,City,Region,PostalCode,Country,HomePhone,Extension,Notes,Rep
ort
sTo"
s-columntypes="3,202,202,202,202,135,135,202,202,202,202,202,202,202,203,3"
s-dataconnection="Sample"
b-tableformat="TRUE"
b-menuformat="FALSE"
s-menuchoice s-menuvalue
b-tableborder="TRUE"
b-tableexpand="TRUE"
b-tableheader="TRUE"
b-listlabels="TRUE"
b-listseparator="TRUE"
i-ListFormat="0" b-makeform="TRUE"
s-recordsource="Employees"
s-displaycolumns="EmployeeID,LastName,FirstName,Title,TitleOfCourtesy,BirthD
ate
e,HireDate,Address,City,Region,PostalCode,Country,HomePhone,Extension,Notes,
Rep
ortsTo"
s-criteria="[HireDate]
EQ {HireDate} +"
s-order
s-sql="SELECT
* FROM Employees
WHERE (HireDate =
'::HireDate::')"
b-procedure="FALSE"
clientside
SuggestedExt="asp"
s-DefaultFields="HireDate="
s-NoRecordsFound="No
records returned."
i-MaxRecords="256"
i-GroupSize="0"
BOTID="0"
u-dblib="_fpclass/fpdblib.inc"
u-dbrgn1="_fpclass/fpdbrgn1.inc"
u-dbrgn2="_fpclass/fpdbrgn2.inc"
tag="TBODY"
local_preview="<tr><td
colspan=64
bgcolor="#FFFF00"
align="left"
width="100%"><font
color="#000000">Database
Results regions will
not preview
unless
this page is fetched
from a Web server
with a web browser.
The following
table
row will repeat once
for every record
returned by the
query.</font></td></tr>"
preview="<tr><td
colspan=64
bgcolor="#FFFF00"
align="left"
width="100%"><font
color="#000000">This
is the start of a
Database Results
region.</font></td></tr>"
--><!--#include
file="_fpclass/fpdblib.inc"--> |
Find the line that begins with
's-sql'. In this code it is the
following line:
s-sql="SELECT * FROM Employees
WHERE (HireDate = '::HireDate::')"
Replace the single quotes around
the names of any date fields
with pound signs
as shown below. s-sql="SELECT *
FROM Employees WHERE (HireDate =
#::HireDate::#)" Save and
preview the page and it should
work.
|