Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 8th, 2005, 10:53 AM
darkmunk darkmunk is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 137 darkmunk User rank is Corporal (100 - 500 Reputation Level)darkmunk User rank is Corporal (100 - 500 Reputation Level)darkmunk User rank is Corporal (100 - 500 Reputation Level)darkmunk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 16 h 16 m 11 sec
Reputation Power: 6
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

Reply With Quote
  #2  
Old December 8th, 2005, 11:26 AM
Themeros Themeros is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 113 Themeros User rank is Private First Class (20 - 50 Reputation Level)Themeros User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 21 m 31 sec
Reputation Power: 4
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

Reply With Quote
  #3  
Old December 8th, 2005, 11:28 AM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 16th Plane (12500 - 12999 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,867 mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 15 h 21 m 57 sec
Reputation Power: 1762
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

Reply With Quote
  #4  
Old December 8th, 2005, 11:52 AM
darkmunk darkmunk is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 137 darkmunk User rank is Corporal (100 - 500 Reputation Level)darkmunk User rank is Corporal (100 - 500 Reputation Level)darkmunk User rank is Corporal (100 - 500 Reputation Level)darkmunk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 16 h 16 m 11 sec
Reputation Power: 6
Whoo hoo! success!
You're magic you are
Thanks
M

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > ASP passing month to detail page


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT