Query issue: multi-part identifier could not be bound

Posted on 2012-08-12
Last Modified: 2012-08-12
Hi Experts,  

The following query returns an error of the multi-part identifier dbo.tbDA_Day_Date could not be bound. Can you help?

WITH FirstCreation AS (SELECT     dbo.tbDA_Day_Date, MIN(ttbDA_Day_dateCreated) AS FirstCreatedDate
                                                  FROM          dbo.tbDA_Day
                                                  GROUP BY dbo.tbDA_Day_Date)
    SELECT     Main.tbDA_Day_date, Main.tbDA_Day_Comments, FirstCreation_1.FirstCreatedDate
     FROM         dbo.tbDA_Day AS Main INNER JOIN
                            FirstCreation AS FirstCreation_1 ON Main.tbDA_Day_date = FirstCreation_1.tbDA_Day_Date
     WHERE     (Main.tbDA_Day_isDeleted = 0)

Open in new window


Question by:nutsch
    LVL 13

    Accepted Solution

    dbo.tbDA_Day_Date is not a field you are missing a dot
    LVL 26

    Expert Comment

    columns dont have any schema identifier... try this

    WITH FirstCreation AS (SELECT     tbDA_Day_Date, MIN(ttbDA_Day_dateCreated) AS FirstCreatedDate
                                                      FROM          dbo.tbDA_Day
                                                      GROUP BY tbDA_Day_Date)
        SELECT     Main.tbDA_Day_date, Main.tbDA_Day_Comments, FirstCreation_1.FirstCreatedDate
         FROM         dbo.tbDA_Day AS Main INNER JOIN
                                FirstCreation AS FirstCreation_1 ON Main.tbDA_Day_date = FirstCreation_1.tbDA_Day_Date
         WHERE     (Main.tbDA_Day_isDeleted = 0)
    LVL 39

    Author Closing Comment

    doh! Thanks a ton.


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now