|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
Passing URL date variables
I'm a PHP programmer, not ASP so this may be a very simple question:
I am trying to pass two variables to an ASP page so I can display a coresponding crystal report. The variables are start_date and end_date. Here is the code: --== <index.html - Start> ==-- <form method="get" action="display.asp"> Date Range: From <input type="text" name="start_date" value="2/1/03"> To <input type="text" name="end_date" value="2/1/03"><br> <input type="submit" value="Display"> <input type="reset" value="Reset"> </form> --== <index.html - end> ==-- --== <display.asp - start> ==-- Set StartDate = request.QUERY_STRING("start_date") Set EndDate = request.QUERY_STRING("end_date") Session("oRpt").ParameterFields.GetItemByName("Start_Date").AddCurrentValue(CDate("StartDate")) Session("oRpt").ParameterFields.GetItemByName("End_Date").AddCurrentValue(CDate("EndDate")) --== <display.asp - end> ==-- I know so little about ASP that I can't even get it to display on the page to make sure the variables are being passed properly. Any help would be appreciated!
__________________
Forget Milk! Gotspy? www.gotspy.com |
|
#2
|
|||
|
|||
|
Quote:
I think all you need to do is remove the sets. So you should just have this Code:
--== <display.asp - start> ==--
StartDate = request.QUERY_STRING("start_date")
EndDate = request.QUERY_STRING("end_date")
Session("oRpt").ParameterFields.GetItemByName("Start_Date").AddCurrentValue(CDate("StartDate"))
Session("oRpt").ParameterFields.GetItemByName("End_Date").AddCurrentValue(CDate("EndDate"))
--== <display.asp - end> ==--
|
|
#3
|
||||
|
||||
|
I removed the sets and got the same thing.
I did notice however that the date that is getting passed in the URL is: display.asp?start_date=3%2F1%2F03&end_date=3%2F30%2F03 I need it to get converted back to: display.asp?start_date=3/1/03&end_date=3/30/03 How would I replace "%2F" with "/"? I guess this is asking two seperate questions? ![]() |
|
#4
|
|||
|
|||
|
You don't need to decode those chars, if you access your parameters via Request.QueryString("start_date") those % thingies will be decoded and you get your original format.
|
|
#5
|
||||
|
||||
|
Well so much for that idea. Thanks for the info.
This is to serve a Crystal Report, I'm going to give them a call in a little bit and see what they say. Thanks for the help. I will post the answer if I get one. |
|
#6
|
||||
|
||||
|
And the answer is...
Set StartDate = request.QUERYSTRING("start_date")
Set EndDate = request.QUERYSTRING("end_date") Session("oRpt").ParameterFields.GetItemByName("Start_Date").AddCurrentValue(CDate(StartDate)) Session("oRpt").ParameterFields.GetItemByName("End_Date").AddCurrentValue(CDate(EndDate)) Take the _ out of QUERY_STRING and remove the "" from the (CDATE("EndDate")) Thanks for the help. ![]() |
|
#7
|
|||
|
|||
|
DOH
HA I didn't even see the underscore their. ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Passing URL date variables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|