|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
I'll just go and sit in the corner and mumble quietly to myself.
Thanks guys, problem solved...... |
|
#17
|
|||
|
|||
|
Quote:
It's usually the simple things that really put the spanner in the works! |
|
#18
|
||||
|
||||
|
Glad its solved now
![]() Its always a good idea first to response.write the variables and query ![]() |
|
#19
|
|||
|
|||
|
Definitely will do from now on.... now i can get back to solving another annoying missing variables problem....
|
|
#20
|
||||
|
||||
|
Glad you sorted out your issue, its usually the simplest things that we miss, but a fresh pair of eyes usually sees the problem!!
I just wanted to point out that you should be able to make your dropdown code more dynamic, eg: Code:
<%
Dim temp
Function pad(x)
If Len(x) = 0 Then x = "0" & x
pad = x
End Function
%>
<form action="stocktotals.aspx?filter=yes" method="post" name="filter">
<div align="center">Filter historical data by date range<br />
<select name="month" id="month">
<option> </option>
<%
For temp = 1 to 12
Response.Write("<option value="" & pad(temp) & "">" & MonthName(temp) & "</option>")
Next
%>
</select>
<select name="year" id="year">
<option> </option>
<%
For temp = 0 to 10
Response.Write("<option value="" & Year(Date) + CInt(temp) & "">" & Year(Date) + CInt(temp) & "</option>")
Next
%>
</select>
<input type="submit" value="Go!" />
</div></form>
|
|
#21
|
|||
|
|||
|
Good plan sync, transferred your code over and it promptly gave me a BC30289: Statement cannot appear within a method body. End of method assumed. error on 'function pad(x)'
Any clues? |
|
#22
|
||||
|
||||
|
Is this .Net you're using?
|
|
#23
|
|||
|
|||
|
Yep, although much of the coding is classic ASP/VBS, thanks to my predecessor coding the whole website completely backwards. Once i've got all the features in I need, i'm going to start the lonnngggg process of getting it all up to scratch, and then some!
Microsoft .NET Framework Version:2.0.50727.42 ASP.NET Version:2.0.50727.42 |
|
#24
|
||||
|
||||
|
OK, I've moved this thread to the .Net forum. With regards the error, this should work but you will need to move the pad function outside of any sub/function that it is in. Try moving it to the top of the page.
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > VBScript - Database - Recordset - Filtering by part of stored date? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|