We help IT Professionals succeed at work.

DATE FILTER

BOEING39
BOEING39 asked
on
tHE ATTACHED DATE FILTER IS NOT INCLUSSIVE OF THE DATE SELECTED.    NEED ASSISTANCE ON CODE CHANGE TO INCLUDE THE DATE SELECTED.  PRESENTLY I AM REQUIRED TO PLACE ONE DAY OUTSIDE THE SELECTED DATE FOR THE FILTER TO INCLUDE THE SELECTED DATE ON EITHER SIDE OF THE DATE RANGE.
IN OTHER WORD TO CAPTURE DATE RANGE   11/11 THRU 11/5/11  I HAVE TO SELECT 11/2/11 THRU 11/06/11.

      
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LAS Home</title>
<style type="text/css">
.style3 {
	text-align: left;
}
.style5 {
	border-color: #c0c0c0;
	border-width: 0;
	background-color: #ffffff;
}
.style6 {
	text-align: center;
	color: #0000FF;
	font-family: Arial;
	font-size: small;
}
.style21 {
	font-size: small;
	font-family: Arial;
}
.style4 {
	font-family: Arial;
}
.style10 {
	font-size: small;
}
.style23 {
	font-size: small;
	color: #0000FF;
}
.style24 {
	color: #0000FF;
}
</style>
</head>

<body>

<form id="form1" runat="server">
	<table style="width: 1150px" cellpadding="0" cellspacing="0" class="style5" align="center">
		<tr>
			<td class="style6"><strong>Delay Search&nbsp;By 
			Date &amp;Station</strong></td>
		</tr>
		<tr>
			<td style="height: 19px"></td>
		</tr>
		<tr>
			<td style="height: 19px">&nbsp;</td>
		</tr>
		<tr>
			<td style="height: 19px">&nbsp;
			<asp:TextBox ID="txtstart" Runat="server" Width="90px" Font-Names="Arial" Font-Size="Small" ForeColor="#0000FF" />
       		<span class="style4"><span class="style23">&nbsp;</span><a href="javascript:;" onclick="window.open('popup.aspx?textbox=txtstart','cal','width=250,height=225,left=270,top=180')"><span class="style10"><img src="../VB_Home/SmallCalendar.gif" border="0" width="16" height="16"></span></a><span class="style23">&nbsp;&nbsp; 
			Start Date</span></span><span class="style24">&nbsp;&nbsp;&nbsp;&nbsp;
			</span>
			<asp:TextBox ID="txtend" Runat="server" Width="90px" Font-Names="Arial" Font-Size="Small" ForeColor="#0000FF" />
       		<span class="style4"><span class="style23">&nbsp;</span><a href="javascript:;" onclick="window.open('popup.aspx?textbox=txtend','cal','width=250,height=225,left=270,top=180')"><span class="style10"><img src="../VB_Home/SmallCalendar.gif" border="0" width="16" height="16"></span></a><span class="style23">&nbsp;&nbsp; 
			End Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="style10">&nbsp;Station:&nbsp;
			<asp:DropDownList runat="server" id="Station" Width="98px" Height="22px" DataValueField="Station" DataTextField="Station" DataSourceID="AccessDataSource4">
			</asp:DropDownList>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="style21">
			<asp:Button runat="server" Text="Submit" id="Button2" Width="77px" Height="25px" />&nbsp;</span><asp:AccessDataSource runat="server" ID="AccessDataSource4" DataFile="../Admin/personnel.mdb" SelectCommand="SELECT DISTINCT [Station] FROM [Dropdown]">
			</asp:AccessDataSource>
			</span> </span></span></td>
		</tr>
		<tr>
			<td style="height: 19px">&nbsp;</td>
		</tr>
		<tr>
			<td class="style3"><span class="style21">
			&nbsp;
			</span><br />
			</td>
		</tr>
		</table>
	<div class="style3">
	<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" DataSourceID="AccessDataSource1" DataKeyNames="ID" AllowSorting="True" Font-Size="Small" Font-Names="Arial" ShowFooter="True" HorizontalAlign="Center" PageSize="15">
		<RowStyle HorizontalAlign="Center" BackColor="White" ForeColor="Black" Width="1220px" />
		<Columns>
			<asp:hyperlinkfield DataNavigateUrlFields="ID" DataNavigateUrlFormatString="DelayStaDate2.aspx?id={0}" DataTextField="Ship" HeaderText="Delay Detail">
				<ControlStyle ForeColor="Red" />
				<HeaderStyle HorizontalAlign="Center" Wrap="True" ForeColor="Red" Width="55px" />
				<ItemStyle HorizontalAlign="Center" Wrap="False" ForeColor="Red" Width="55px" />
			</asp:hyperlinkfield>
			<asp:boundfield DataField="Dates" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Dates" SortExpression="Dates">
				<HeaderStyle HorizontalAlign="Center" Width="75px" />
				<ItemStyle HorizontalAlign="Center" Width="75px" />
			</asp:boundfield>
			<asp:boundfield DataField="Ship" HeaderText="Ship#" SortExpression="Ship">
				<HeaderStyle HorizontalAlign="Center" Width="55px" />
				<ItemStyle HorizontalAlign="Center" Width="55px" />
			</asp:boundfield>
			<asp:boundfield DataField="Station" HeaderText="Station" SortExpression="Station">
				<HeaderStyle HorizontalAlign="Center" Width="55px" />
				<ItemStyle HorizontalAlign="Center" Width="55px" />
			</asp:boundfield>
			<asp:boundfield DataField="Inbd" HeaderText="Inbd Flt#" SortExpression="Inbd">
				<HeaderStyle HorizontalAlign="Center" Width="55px" />
				<ItemStyle HorizontalAlign="Center" Width="55px" />
			</asp:boundfield>
			<asp:boundfield DataField="Otbd" HeaderText="Otbd Flt#" SortExpression="Otbd">
				<HeaderStyle HorizontalAlign="Center" Width="55px" />
				<ItemStyle HorizontalAlign="Center" Width="55px" />
			</asp:boundfield>
			<asp:boundfield DataField="Dep" DataFormatString="{0:HH:mm}" HeaderText="Dep Time" SortExpression="Dep">
				<HeaderStyle HorizontalAlign="Center" Width="55px" />
				<ItemStyle HorizontalAlign="Center" Width="55px" />
			</asp:boundfield>
			<asp:boundfield DataField="Ground" DataFormatString="{0:HH:mm}" HeaderText="Ground Time" SortExpression="Ground">
				<HeaderStyle HorizontalAlign="Center" Width="55px" />
				<ItemStyle HorizontalAlign="Center" Width="55px" />
			</asp:boundfield>
			<asp:boundfield DataField="Code" HeaderText="Delay Code" SortExpression="Code">
				<HeaderStyle HorizontalAlign="Center" Width="55px" />
				<ItemStyle HorizontalAlign="Center" Width="55px" />
			</asp:boundfield>
			<asp:boundfield DataField="Time" DataFormatString="{0:HH:mm}" HeaderText="Delay Time" SortExpression="Time">
				<HeaderStyle HorizontalAlign="Center" Width="55px" />
				<ItemStyle HorizontalAlign="Center" Width="55px" />
			</asp:boundfield>
			<asp:boundfield DataField="RON" HeaderText="RON " SortExpression="RON">
				<HeaderStyle HorizontalAlign="Center" />
				<ItemStyle HorizontalAlign="Center" Width="55px" />
			</asp:boundfield>
			<asp:boundfield DataField="Reason" HeaderText="Delay Reason" SortExpression="Reason">
				<HeaderStyle HorizontalAlign="Center" Width="550px" />
				<ItemStyle HorizontalAlign="Left" Width="550px" />
			</asp:boundfield>
		</Columns>
		<FooterStyle BackColor="#0033CC" ForeColor="White" />
		<PagerStyle HorizontalAlign="Center" BackColor="#0066CC" ForeColor="White" />
		<HeaderStyle BackColor="#0033CC" ForeColor="White" />
		<AlternatingRowStyle BackColor="Blue" ForeColor="White" Width="1200px" />
	</asp:GridView>
	</div>
	<asp:AccessDataSource runat="server" ID="AccessDataSource1" DataFile="database2.mdb" SelectCommand="SELECT [ID], [Dates], [Ship], [Station], [Inbd], [Otbd], [Dep], [Ground], [Code], [Time], [RON], [Reason] FROM [Delay] WHERE (([Dates] &gt; ?) AND ([Dates] &lt; ?)) and ([station] = ?) ORDER BY [DATEs] DESC">
	
		
	<SelectParameters>
		<asp:controlparameter ControlID="txtstart" PropertyName="Text" Name="Date" />
		<asp:controlparameter ControlID="txtend" PropertyName="Text" Name="Date2" />
		<asp:controlparameter ControlID="Station" PropertyName="SelectedValue" Name="Station" />
	</SelectParameters>
	
	</asp:AccessDataSource>
</form>

<p>&nbsp;</p>

</body>

</html>

Open in new window

Comment
Watch Question

Freelance programmer / Consultant
CERTIFIED EXPERT
Commented:
instead of > use >=
instead of < use <=

Author

Commented:
Thx worked great....

Explore More ContentExplore courses, solutions, and other research materials related to this topic.