Type mismatch

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

anonymous_at_discussions.microsoft.com
Date: 01/11/05


Date: Tue, 11 Jan 2005 07:11:22 -0800

hi,
guessing here but i think the problem is that your select
seem to be select 5 different dates and temp is declared
as A date. you may have to rewrite a little - have 5 temps
and 5 selects.
>-----Original Message-----
>Hi,
>
>I am trying to create a function that need to return a
date but getting the
>error 13 type mismatch in my select :
>
>Public Function ActivationDate(ActDateNotice As Date,
IdBranch As Integer)
>As Date
>Dim temp As Date
>
>temp = "SELECT
>MIN
(ExerDateNotice,ExerDateRenOption,ExerDateExpRights,ExerDat
eCanrights,ExerDatePurOption)FROM
>[General information] WHERE IdBranch = " & IdBranch
>
>ActivationDate = DateAdd("m", -12, temp)
>End Function
>
>>From my understanding, it is something that has to be
done with data type, I
>have tried different data type in the function even using
everything as
>Variant but still getting the same error. The fields in
the table are the
>correct type, date are short date and idbranch is a
autonumber
>
>Can anyone tell me what I am doing wrong
>
>Thanks
>
>Alain
>
>
>.
>



Relevant Pages

  • RE: changing datatype thru code
    ... check the data types of the temp table, change the ones the query got ... INSERT INTO TempTable (TextField, IntField) ... Assuming is a text data type that contains data that can be ...
    (microsoft.public.access.formscoding)
  • Re: OUTPUT of type TABLE
    ... can use a #temp table in two ways. ... Pro SQL Server 2000 Database Design ... > Is it possible to send a table, derived from the TABLE> data type, from one SPROC to another? ...
    (microsoft.public.sqlserver.programming)
  • Re: changing datatype thru code
    ... control what data type access chooses for each control. ... number field but in the back end tables the data type is text. ... database with the temp tableand their appropriate ...
    (microsoft.public.access.formscoding)
  • Re: error importing excel data to access table
    ... specification for Excel files, rather than letting Access decide for itself ... fields will be text data type, ... to the temp table on the PK fieldand then update ... Then perform the transformation steps to get the data into your final ...
    (microsoft.public.access.externaldata)
  • Re: Type mismatch
    ... The third argument of the DateAdd function must be a date data type. ... DateAdd function does not accept an SQL statement in any of its arguments. ... > Dim temp As Date ...
    (microsoft.public.access.formscoding)