Ask a Question related to ASP, Design and Development.

  1. #1

    Default Type mismatch?

    Hi i'm getting a type mismatch error, anyone tell me why pls?


    conn.Execute "DELETE FROM Bmemo WHERE (tDate <= '" & date() & "')"


    tDate is a date field in an Access database....

    Many thanks




    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.516 / Virus Database: 313 - Release Date: 01/09/2003


    xool Guest

  2. Similar Questions and Discussions

    1. Type mismatch error
      This query works fine on a live server using an MSSQL database: <cfquery name="qIndex" datasource="#appDSN#" username="shampoo"...
    2. Interface Type Mismatch
      This works in Java, so it is not clear why Actionscript does not implement it the same way. If an instance of a class that implements an Interface...
    3. Type Mismatch
      I'm at my wits end here. I am getting type mismatch error in a ASP page when I try to multiply decimals*integers. This shouldn't be this difficult....
    4. Type mismatch in expression
      Dear anyone, I used the wizard to make a form, but when I try to go from design view to form view an eooro message comes up "Type mismatch in...
    5. Type Mismatch again
      Hi, One page passes a strIssueNo to another, so on the 2nd page: Dim IssueNo IssueNo = Request.Item("strIssueNo") This 2nd page is designed...
  3. #2

    Default Re: Type mismatch?

    > Hi i'm getting a type mismatch error, anyone tell me why pls?

    You have to surround the date with pound signs when using Access.

    Try this instead:
    conn.Execute "DELETE FROM Bmemo WHERE (tDate <= #" & date() & "#)"


    Randy Rahbar Guest

  4. #3

    Default Re: Type mismatch?

    Why do you need to pass in the date from ASP? Access knows the date.

    conn.Execute "DELETE Bmemo WHERE tDate <= Date()"

    As Randy pointed out, if you're passing the date from outside the database,
    you need to delimit it correctly.

    conn.Execute "DELETE Bmemo WHERE tDate <= #" & Date() & "#"

    I might even go so far as to suggest putting the date in an ISO format, e.g.
    yyyy-mm-dd, to avoid ambiguity.



    "xool" <me@memail.net> wrote in message
    news:eZbBupHeDHA.2228@TK2MSFTNGP12.phx.gbl...
    > Hi i'm getting a type mismatch error, anyone tell me why pls?
    >
    >
    > conn.Execute "DELETE FROM Bmemo WHERE (tDate <= '" & date() & "')"
    >
    >
    > tDate is a date field in an Access database....
    >
    > Many thanks
    >
    >
    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    > Version: 6.0.516 / Virus Database: 313 - Release Date: 01/09/2003
    >
    >

    Aaron Bertrand - MVP Guest

  5. #4

    Default Re: Type mismatch?

    Great that's it, many thanks Randy

    "Randy Rahbar" <rvrahbarAThotmail.com> wrote in message
    news:O4AI$vHeDHA.696@TK2MSFTNGP09.phx.gbl...
    > > Hi i'm getting a type mismatch error, anyone tell me why pls?
    >
    > You have to surround the date with pound signs when using Access.
    >
    > Try this instead:
    > conn.Execute "DELETE FROM Bmemo WHERE (tDate <= #" & date() & "#)"
    >
    >

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.516 / Virus Database: 313 - Release Date: 01/09/2003


    xool Guest

  6. #5

    Default Re: Type mismatch?

    Not to take anything from Randy's answer, but if you use the method I
    recommended, you don't have to worry about date formats / regional settings
    messing up the interpretation of date() (e.g. if a US-based access database
    is placed on a UK server; the internal comparison is much safer than
    external).





    "xool" <me@memail.net> wrote in message
    news:O7wTH8HeDHA.2304@TK2MSFTNGP11.phx.gbl...
    > Great that's it, many thanks Randy

    Aaron Bertrand - MVP Guest

  7. #6

    Default Re: Type mismatch?

    Ok will do, many thanks Aaron


    "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
    news:uyfW2EIeDHA.2408@TK2MSFTNGP09.phx.gbl...
    > Not to take anything from Randy's answer, but if you use the method I
    > recommended, you don't have to worry about date formats / regional
    settings
    > messing up the interpretation of date() (e.g. if a US-based access
    database
    > is placed on a UK server; the internal comparison is much safer than
    > external).
    >
    >
    >
    >
    >
    > "xool" <me@memail.net> wrote in message
    > news:O7wTH8HeDHA.2304@TK2MSFTNGP11.phx.gbl...
    > > Great that's it, many thanks Randy
    >
    >

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.516 / Virus Database: 313 - Release Date: 01/09/2003


    xool Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139