Consulting

Results 1 to 2 of 2

Thread: Run-time error '3464' Datatype mismatch in criteria expression: PLEASE HELP!!

  1. #1

    Run-time error '3464' Datatype mismatch in criteria expression: PLEASE HELP!!

    I have been pulling my hair out trying to figure out why I'm getting this error from my Access application. I have 2 linked SQL Server tables (dbo.UDS_MAINTENANCE, dbo.ESTATE_MASTER) and a I'm trying to join a linked excel (UEP_SUMMARY) to one of them in an INSERT INTO SELECT statement. My vba code is below:

    GlobalPED = objCMD.Parameters("PED").Value

    Dim InsUEPSQL As String

    InsUEPSQL = "INSERT INTO dbo_UDS_MAINTENANCE(PED,ENTITY,ESTATE_ID,NAIC,ESTA TE_NAME,UDS_STATE,UDS_TYPE) " & _
    "SELECT DISTINCT UEP.COMPANY_IGA AS ESTATE_ID, " & _
    "'" & GlobalPED & "' AS PED, " & _
    "UEP.FUND AS ENTITY, " & _
    "EM.NAIC_GROUP AS NAIC, " & _
    "EM.ESTATE_NAME AS ESTATE_NAME, " & _
    "EM.UDS_STATE AS STATE, " & _
    "'UEP' AS UDS_TYPE " & _
    "FROM UEP_SUMMARY UEP " & _
    "INNER JOIN dbo_ESTATE_MASTER EM ON INT(UEP.COMPANY_IGA) = INT(EM.FIGA_ID) " & _
    "WHERE UEP.FUND = 'FIGA' "

    Debug.Print InsUEPSQL
    DoCmd.RunSQL InsUEPSQL

    StatusBar "UEP Information obtained for FIGA..."

    Me.Requery

    Any assistance is greatly appreciated!

  2. #2
    VBAX Tutor
    Joined
    Mar 2014
    Posts
    208
    Location
    Data mismatch means you joined a number with a string. Cant do that.
    The two data types must match.
    1 table field is set to number
    the other field is a string.

    You CAN cheat by making a query that converts the number to string...CSTR(fld)
    THEN Join.

Posting Permissions

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