Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Type mismatch error

    This query works fine on a live server using an MSSQL database:

    <cfquery name="qIndex" datasource="#appDSN#" username="shampoo"
    password="conditioner">
    SELECT sch.ID, sch.Date, sch.Time, cat.Category,
    sch.sName, sch.Email, sch.Status, sch.HomePhone,
    sch.Dayphone, sch.ApplicationNo, sch.Note
    FROM sfiec_scheduling sch, sfiec_scheduleCat cat
    WHERE sch.Status = cat.CatID
    <cfif isDefined("URL.ShowAll")>
    <cfif isDefined("URL.past30")>
    AND sch.Date < #CurrentDate# AND sch.Date > #CurrentDate#
    - 31
    </cfif>
    <cfelse>
    AND sch.Date >= #CurrentDate# - 1</cfif>
    ORDER BY sch.Date ASC, sch.Time ASC </cfquery>

    But when I try to use it locally on my testing server, I get the following
    error:

    Error Executing Database Query.
    Type mismatch in expression.

    The error occurred in
    C:\CFusionMX7\wwwroot\SFInstitute\website\pub\sche duling\index.cfm: line 88
    Called from
    C:\CFusionMX7\wwwroot\SFInstitute\website\pub\sche duling\index.cfm: line 1
    Called from
    C:\CFusionMX7\wwwroot\SFInstitute\website\pub\sche duling\index.cfm: line 88
    Called from
    C:\CFusionMX7\wwwroot\SFInstitute\website\pub\sche duling\index.cfm: line 1

    86 : </cfif>
    87 : <cfelse>
    88 : AND sch.Date >= #CurrentDate# - 1</cfif>
    89 : ORDER BY sch.Date ASC, sch.Time ASC </cfquery>Text

    Table was imported from the MSSQL table, but have also tried to recreate as a
    new table. Date and Time fields are Date/Time in Access..datetime in MSSQL.

    I also get a similar error when trying to insert a record in Access. I've also
    tried running without the sort <cfif> statement, but get a similar error.

    Thanks.

    getziggy Guest

  2. Similar Questions and Discussions

    1. data type mismatch error...
      HI guys, getting pretty stressed with this haha! it's probably something simple...right I have this registration form that does multiple checks...
    2. 0x800A000D - Type Mismatch Error
      I am not sure what is goint on. Here's my code inWeekStart = "11" inWeekEnd = "14" Compyear = "2003" Dim rsSQL, strSQL, cmSQL dim...
    3. Type mismatch Session error
      You'll need to post a snippet of relevant code. Ray at work "TD" <TurboDuster@noyahoospam.com> wrote in message...
    4. Confused with the type mismatch error
      I tried your simple example and got no type mismatch. I even modified it so that I was comparing a string to a number and got no type mismatch (it...
    5. Long Raw Type Mismatch error
      I'm new to using long raw fields with ASP. I know it would be easier to leave the files on the file system, but the client wants them in the...
  3. #2

    Default Re: Type mismatch error

    Ditto Dan.

    Anyway, there are a lot of problems with that posted code.

    Here's a possible bandaid:
    Change #CurrentDate# - 1 to #CreateODBCDateTime (CurrentDate -1)#
    MikerRoo 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