Invalid column name 'ProjectQuestionContentDateTime'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • macupryk
    New Member
    • Sep 2006
    • 24

    Invalid column name 'ProjectQuestionContentDateTime'

    I build the following:

    USE [RG_ProjectData]
    GO
    CREATE PROCEDURE AddProjectQuest ionContentFrequ ency
    @ProjectQuestio nId int,
    @ProjectQuestio nContent nvarchar(255),
    @ProjectQuestio nContentFrequen cy int,
    @ProjectQuestio nContentDateTim e datetime
    AS

    SET NOCOUNT ON
    select ProjectQuestion Id, ProjectResponse Content, count (*) ProjectQuestion ContentFrequenc y --------------give alias here
    from ProjectResponse
    WHERE ProjectQuestion ContentDateTime > CAST( convert(VARCHAR (8),getdate(),1 12) as datetime)
    group by ProjectQuestion Id, ProjectResponse Content


    INSERT INTO [ProjectQuestion ContentFrequenc y] (
    ProjectQuestion Id,
    ProjectQuestion Content,
    ProjectQuestion ContentFrequenc y,
    ProjectQuestion ContentDateTime )
    VALUES (
    @ProjectQuestio nId,
    @ProjectQuestio nContent,
    @ProjectQuestio nContentFrequen cy,
    @ProjectQuestio nContentDateTim e)
    GO
    I get the following error:

    Msg 207, Level 16, State 1, Procedure AddProjectQuest ionContentFrequ ency, Line 11
    Invalid column name 'ProjectQuestio nContentDateTim e'.
  • OOlafsson
    New Member
    • Oct 2006
    • 1

    #2
    is the compatibily level for the database set st SQL 2005 (9.0) ?
    try SQL 2000.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32653

      #3
      It was defined earlier ('@ProjectQuest ionContentDateT ime') as a variable.
      Is it possible that you've mixed up a column name with a variable name by mistake.

      Comment

      Working...