Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

FN-FORUM: asp/access SQL help

date posted 1st December 2006 14:41

Its friday and my brain obviously isnt working how it should...

I have an ASP script which is supposed to query an access database for all records that have a date occuring in the current month or, if a date has been passed to the script, occuring in the requested month.

The important bits I have are...

--------------
dim thisMonth

if len(Request.QueryString("date")) > 0 then
thisMonth = split(Request.QueryString("date"), "/")
else
thisMonth = Month(Date)
end if
--------------

and then for the SQL query...

--------------
if len(Request.QueryString("date")) > 0 then
cmdTemp.CommandText = "SELECT * FROM events WHERE eventDate LIKE '**/" & thisMonth(2) & "/**'"
else
cmdTemp.CommandText = "SELECT * FROM events WHERE eventDate LIKE '**/" & thisMonth & "/**'"
end if
--------------

it works if you dont set a date (or it at least writes out the SQL query I've told it to) but as soon as you pass it a date you get 'Error Type: Response object, ASP 0106 (0x80020005)An unhandled data type was encountered.'

is it to do with the Split statement or the SQL query? also, whats the correct SQL query if the eventDate is structured as 01/12/2006?

cheers



Messages by Day
December 31st 2006
December 30th 2006
December 29th 2006
December 28th 2006
December 27th 2006
December 26th 2006
December 25th 2006
December 24th 2006
December 23rd 2006
December 22nd 2006
December 21st 2006
December 20th 2006
December 19th 2006
December 18th 2006
December 17th 2006
December 16th 2006
December 15th 2006
December 14th 2006
December 13th 2006
December 12th 2006
December 11th 2006
December 10th 2006
December 9th 2006
December 8th 2006
December 7th 2006
December 6th 2006
December 5th 2006
December 4th 2006
December 3rd 2006
December 2nd 2006
December 1st 2006


Messages by Month
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000