a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

trouble with dates in a table

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> trouble with dates in a table
Page: [1]
 
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
Spooky

 

Posts: 26617
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: trouble with dates in a table - 7/24/2006 15:50:47   
Instead of the hard coded date - '2006-07-31 00:00:00' you could use your basic : ' "&request.form("fieldname")&"'
However, it depends on the application and security requirements

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to adam2804)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> trouble with dates in a table
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts