adam2804
Posts: 34 Joined: 6/6/2006 Status: offline
|
trouble with dates in a table - 7/24/2006 10:36:40
Hello people, I'm having a bit of difficulty putting together a form to search on some date fields. I know it's probably something simple but I would appreciate if anyone could spot anything:
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="../../_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p>Date From <input type="text" value="01/07/2006" name="DateFrom" size="20"><br>
Date To
<input type="text" value="31/07/2006" name="DateTo" size="20"> </p>
<p> <input type="submit" value="Submit" name="Submit"></p>
</form>
<table>
<thead>
<tr>
<th ALIGN="LEFT"><b>Contract No</b></th>
<th ALIGN="LEFT"><b>ContractStart</b></th>
<th ALIGN="LEFT"><b>ContractEnd</b></th>
<th ALIGN="LEFT"><b>ContractValue</b></th>
<th ALIGN="LEFT"><b>ContractNumberOfPayments</b></th>
<th ALIGN="LEFT"><b>TASCode</b></th>
<th ALIGN="LEFT"><b>Payment</b></th>
<th ALIGN="LEFT"><b>Description</b></th>
<th ALIGN="LEFT"><b>InvoicedToTAS</b></th>
</tr>
</thead>
<tbody>
<!--#include file="../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT ContractNum, ContractStart, ContractEnd, ContractValue, ContractNumberOfPayments, TASCode, CAST(PaymentNumber AS VARCHAR(5)) + '/' + CAST(ContractNumberOfPayments AS VARCHAR(5)) AS Payment, Description, InvoicedToTAS AS InvoicedToTAS FROM dbo.FN_InvoiceList(DEFAULT) FN_InvoiceList WHERE (InvoiceDate > CONVERT(DATETIME, '2006-07-31 00:00:00', 102) AND InvoiceDate < CONVERT(DATETIME, '2006-07-31 00:00:00', 102))"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=9 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="database"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ContractNum=200&ContractStart=135&ContractEnd=135&ContractValue=131&ContractNumberOfPayments=3&TASCode=200&Payment=200&Description=200&InvoicedToTAS=11&"
fp_iDisplayCols=9
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
Where it says 'CONVERT' in the SQL I want to refer to the two text boxes I have on the form. Whats the easiest way to do that? Thanks Adam
|