locked
Operand type clash: time is incompatible with date RRS feed

  • Question

  • User57520091 posted

    Hi, I am trying to create a new SProc for inserting data when I hit this error after trying to execute:

    Operand type clash: time is incompatible with date

    Please kindly advice. Thanks!

     

    USE [Matrix]
    GO
    /****** Object:  StoredProcedure [dbo].[Campaign_Add]    Script Date: 10/14/2011 18:18:17 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO

    CREATE PROCEDURE [dbo].[Campaign_Add]

     (

        @Code     nvarchar(50) =NULL,
     @Name     nvarchar(150) =NULL,
     @Type        nvarchar(50) =NULL,
     @ActiveDateFrom   Time =NULL,
     @ActiveDateTo      Time =NULL,
     @AddedBy    nvarchar(50) =NULL,
     @AddedOn    datetime  =NULL
     
     
     )
     AS
     BEGIN
     
      INSERT INTO [Cam]
        
        (
     

     ,
     [Name] ,
     [Type] ,
     [ActiveDateFrom] ,  
     [ActiveDateTo] ,
     [AddedBy]  ,
     [AddedOn] 

          )
         
         
        VALUES
        (@Code ,
     @Name ,
     @Type ,
     @ActiveDateFrom ,  
     @ActiveDateTo  ,
     @AddedBy  ,
     GETDATE()
     )
        
       
        
         ;SELECT SCOPE_IDENTITY();
        
      END  

     

    Friday, October 14, 2011 10:14 AM

Answers

  • User-1590642642 posted

    What is the datatype of these columns in your table?:

    [ActiveDateFrom] ,  
     [ActiveDateTo] ,

    You need to use the same datatype for your parameters,

    @ActiveDateFrom   Time =NULL,
     @ActiveDateTo      Time =NULL,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 14, 2011 10:17 AM

All replies

  • User-1590642642 posted

    What is the datatype of these columns in your table?:

    [ActiveDateFrom] ,  
     [ActiveDateTo] ,

    You need to use the same datatype for your parameters,

    @ActiveDateFrom   Time =NULL,
     @ActiveDateTo      Time =NULL,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 14, 2011 10:17 AM
  • User57520091 posted

    Oh my this is embarassing, thanks!

    Friday, October 14, 2011 10:28 AM