Query issue: multi-part identifier could not be bound

Posted on 2012-08-12
Medium Priority
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

p_nuts earned 2000 total points
ID: 38284880
dbo.tbDA_Day_Date is not a field you are missing a dot
LVL 26

Expert Comment

ID: 38284974
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

ID: 38285555
doh! Thanks a ton.


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

850 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