SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast hombre_de_las_ca's Avatar
    Join Date
    Apr 2005
    Location
    Bangalore, India
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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???
    CaveMan
    Don't ask what your Country can do for you,
    Ask what you can do for your Country.

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    1 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
    That is assuming objrs.find("date") is a date data type.

  3. #3
    SitePoint Enthusiast hombre_de_las_ca's Avatar
    Join Date
    Apr 2005
    Location
    Bangalore, India
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    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.

  4. #4
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
    If you ever get this error then check datatypes.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •