Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9129803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:49:53+00:00 2026-06-17T07:49:53+00:00

Thanks to the guys with suggestions on date conversion yesterday, I now have a

  • 0

Thanks to the guys with suggestions on date conversion yesterday, I now have a working SELECT script.

Unfortunately, when I try to turn it into an UPDATE script, I get the dreaded

Msg 4104, Level 16, State 1, Line 25
The multi-part identifier "mbrProject.ID" could not be bound.

The entire script should insert the date from mbrProject into ProjectDates, for each matching ID (mbrProject.[ID] = ProjectDates.[Project_ID]), whilst resolving mixed US & UK format dates in mbrProject, due to users having incorrect country settings when updating the tables (not changeable from my end).

Update ProjectDates
SET ProjectDates.[Start_Date] =

(
select right([Start_Date],4) +  
    case 
        when len([Start_Date])=10 then 
            substring([Start_Date],4,2) + left([Start_Date],2)

        else    right('0' + left([Start_Date],firstIndex-1),2) + 
                right('0' + substring([Start_Date],firstIndex+1,secondIndex - firstIndex-1),2) 
                end

from 
    (
    select mp.[Start_Date], charindex('/',mp.[Start_Date],1) firstIndex,
          charindex('/',mp.[Start_Date],charindex('/',mp.[Start_Date],1)+1) secondIndex

    from mbrProject mp
    join ProjectDates pd
    on mp.ID = pd.Project_ID
    )A

where mbrProject.[ID] = ProjectDates.Project_ID
)

If I run ONLY the SELECT statement, it works fine, returning the correct values.
i.e Everything from

select right([Start_Date],4) +  
    case 

down to

from mbrProject mp
join ProjectDates pd
on mp.ID = pd.Project_ID
)A

However, as soon as I try to wrap it up in the UPDATE statement, I get the error.

I know that this is down to syntax, but wherever I try to move stuff, I can’t quite figure it out.

Any ideas please?

Thanks
Craig

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:49:55+00:00Added an answer on June 17, 2026 at 7:49 am

    Try this:

    UPDATE PR
    SET PR.[Start_Date] = A.[Corrected_Start_Date]
    FROM ProjectDates PR
        JOIN
        (
            SELECT
                [Id],
                RIGHT([Start_Date],4) +  
                CASE
                    WHEN len([Start_Date])=10
                    THEN substring([Start_Date],4,2) + LEFT([Start_Date],2)
                    ELSE RIGHT('0' + LEFT([Start_Date],firstIndex-1),2) + 
                             RIGHT('0' + substring([Start_Date],firstIndex+1,secondIndex - firstIndex-1),2) 
                END [Corrected_Start_Date]
            FROM 
            (
                SELECT
                            [Id],
                            [Start_Date],
                            charindex('/',[Start_Date],1) firstIndex,
                            charindex('/',[Start_Date],charindex('/',[Start_Date],1)+1) secondIndex
                FROM mbrProject
            ) S
        ) A
    ON A.[ID] = PR.[Project_ID]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thanks to some help I received yesterday I've got some dynamic summing working on
I'm working on a suggestions tool: When the user types a char into a
thanks for all the help guys but now the nature of the question has
Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here:
thanks guys.i managed to complete it.million thanks again specially for DAVID,WM-EDDIE and S.LOTT.also STACKOVERFLOW
Update: Thanks guys, I didn't realize it was very close to zero but not
Hi guys thanks for pay attention to this. Well im trying to replace every
Thanks to the epic work of Dennis Williamson, I am now able to calculate
Thanks for reading this. I have no idea why this is throwing a NullReferenceException
Hey, guys, I tried to ask this yesterday but I didn't explain myself clearly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.