|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP passing month to detail page
even with a whole bunch of new(to me) VB date functions I still can't formulate a SQL string to display all the records in a month passed in the URL by the previous page.
My DB has the column start_date (formatted as dd/mm/yyyy) from which I have successfully extracted the number of the month that the user clicks. My page sends that number in the url: "trip_dates.asp?myMonth=3" and my detail page uses this unsuccessful SQL to display all the trips in March: strSQL="SELECT * FROM dest_search" if myMonth <> "" then strSQL = strSQL & "WHERE start_date(month(start_date)) LIKE" & myMonth &" ORDER BY start_date" end if oRS.Open strSQL, oConn, 2, 3 I have tried all sorts of permutations as you can see from this! please help. Thanks Mark |
|
#2
|
|||
|
|||
|
Code:
if myMonth <> "" then dt1 = "01/" & myMonth & "/" & Year(now) dt2 = "31/" & myMonth & "/" & Year(now) strSQL = strSQL & " WHERE start_date >= '" & dt1 & "' AND start_date <= '" & dt2 & "' ORDER BY start_date" end if ...something like that |
|
#3
|
||||
|
||||
|
try this:
Code:
strSQL="SELECT * FROM dest_search"
if request("myMonth") <> "" then
strSQL = strSQL & " WHERE month(start_date) = " & request("myMonth") & " ORDER BY start_date"
end if
oRS.Open strSQL, oConn, 2, 3
__________________
Come JOIN the party!!! Quote of the Month: Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
|
#4
|
|||
|
|||
|
Whoo hoo! success!
You're magic you are Thanks M |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > ASP passing month to detail page |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|