SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Date compare failure!!!
-
May 3, 2005, 16:17 #1
- Join Date
- Apr 2005
- Location
- Bangalore, India
- Posts
- 90
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Date compare failure!!!
i have a variable called newvalue1 which contains a date such as
newvalue1 = request.form("tf1")
where tf1 is the date sent from the previous page in the format 4/5/2005
now when i give the following statement it gives an error
objrs.find ("date") < newvalue1
"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
also if i give
objrs.find ("date") = newvalue1
i get a " type Mismatch" error
any thing wrong???
CaveManDon't ask what your Country can do for you,
Ask what you can do for your Country.
-
May 4, 2005, 14:16 #2
- Join Date
- Oct 2000
- Location
- Philadelphia, PA
- Posts
- 4,708
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
You are comparing a date data type to a non-date data type. Try this:
Code:newvalue1 = CDate(request.form("tf1")) If objrs.find ("date") < newvalue1 then 'blah End if
"Does this napkin smell like chloroform?"
...now with SnapFoo!
My Blog | My Twitter | My Company | SitePoint Podcast
*** Matt Mullenweg on the SitePoint Podcast ***
-
May 5, 2005, 11:39 #3
- Join Date
- Apr 2005
- Location
- Bangalore, India
- Posts
- 90
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks a lot....had been giving the date to the sql statements as # date #
and it always worked... never thought of checking the data type...
Don't ask what your Country can do for you,
Ask what you can do for your Country.
-
May 5, 2005, 15:09 #4
- Join Date
- Oct 2000
- Location
- Philadelphia, PA
- Posts
- 4,708
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.""Does this napkin smell like chloroform?"
...now with SnapFoo!
My Blog | My Twitter | My Company | SitePoint Podcast
*** Matt Mullenweg on the SitePoint Podcast ***
Bookmarks