Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    1

    Unanswered: Conversion ERROR

    This is the error message I get:
    Server: Msg 242, Level 16, State 3, Line 1
    The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

    This is the query:
    Select Qual_ins.CompanyCode, Qual_ins.ParticipantCode, Qual_ins.Ins_Code, Qual_ins.Plan_Code,
    dbo.PremiumRate(Qual_Ins.Crit,Qual_Ins.PQB_Spec,Pl an_Mas.Extend_Fee,
    Qual_Ins.Adjpremium,Qual_Ins.Adjpremiumper,Qual_In s.Adjpremend,
    GetDate(),Qual_Ins.Cover_Amt, Plan_Mas.CR_A, Plan_Mas.CR_B,
    Plan_Mas.CR_C, Plan_Mas.CR_D, Plan_Mas.CR_E, Plan_Mas.CR_F,
    Plan_Mas.CR_G, Plan_Mas.CR_H, Plan_Mas.CR_I, Plan_Mas.CR_J,
    Plan_Mas.CR_K, Plan_Mas.CR_L, Plan_Mas.CR_M, Plan_Mas.CR_N,
    Plan_Mas.CR_O) AS PremiumRate
    FROM Qual_ins, Plan_Mas
    WHERE Qual_Ins.CompanyCode = 'ACME'
    AND Qual_ins.ParticipantCode = 4
    AND Plan_Mas.CompanyCode = Qual_ins.CompanyCode
    AND Plan_Mas.Ins_Code = Qual_ins.Ins_Code
    AND Plan_Mas.Plan_Code = Qual_ins.Plan_Code
    Order BY Qual_ins.Ins_Code

    Please let me know if you need to see my PremiumRate (User Defined Function) in order to help me elimate this error message.
    Any help is appreciate!
    I'm new to this.... "Hello" to all!

    Shuvi

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Based on the error message, I'd guess that you are trying to convert a string (CHAR or VARCHAR) to a DATETIME or a SMALLDATETIME. If that is the case, then one or more rows in your data isn't a valid date string.

    -PatP

Posting Permissions

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