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

  • Home
  • SEARCH
  • 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 8811429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:21:44+00:00 2026-06-14T03:21:44+00:00

i need update fields ‘ErrCode’ from select between 2 table. i try query it’s

  • 0

i need update fields ‘ErrCode’ from select between 2 table. i try query it’s update all record.

Table LeaveEmp

EmpRun Date                      Start                    Stop
00003  2012-10-02 00:00:00.000   2012-10-02 13:00:00.000  2012-10-02 17:00:00.000
00004  2012-10-02 00:00:00.000   NULL                     NULL

Table modifyTime

EmpNo  cDate                     cIn                      cOut                      ErrCode
00001  2012-10-02 00:00:00.000   NULL                     NULL                      NULL
00002  2012-10-02 00:00:00.000   2012-10-02 07:35:00.000  2012-10-02 20:12:00.000   NULL
00003  2012-10-02 00:00:00.000   2012-10-02 13:00:00.000  2012-10-02 17:00:00.000   NULL 
00004  2012-10-02 00:00:00.000   NULL                     NULL                      NULL
00005  2012-10-02 00:00:00.000   2012-10-02 07:13:00.000  2012-10-02 19:24:00.000   NULL
00006  2012-10-02 00:00:00.000   2012-10-02 07:55:00.000  2012-10-02 20:58:00.000   NULL
*****00003,00004 from Table LeaveEmp.step one i insert Table LeaveEmp to Table modifyTime**

code:

UPDATE modifyTime
SET ErrCode = '3'
WHERE EXISTS (SELECT coalesce(l.Start,'2012-10-02')
FROM LeaveEmp l
WHERE l.Start = '2012-10-02' and modifyTime.cDate = '2012-10-02')

this get output:

EmpNo  cDate                     cIn                      cOut                      ErrCode
00001  2012-10-02 00:00:00.000   NULL                     NULL                      3
00002  2012-10-02 00:00:00.000   2012-10-02 07:35:00.000  2012-10-02 20:12:00.000   3
00003  2012-10-02 00:00:00.000   2012-10-02 13:00:00.000  2012-10-02 17:00:00.000   3 
00004  2012-10-02 00:00:00.000   NULL                     NULL                      3
00005  2012-10-02 00:00:00.000   2012-10-02 07:13:00.000  2012-10-02 19:24:00.000   3
00006  2012-10-02 00:00:00.000   2012-10-02 07:55:00.000  2012-10-02 20:58:00.000   3

but i need output:

EmpNo  cDate                     cIn                      cOut                      ErrCode
00001  2012-10-02 00:00:00.000   NULL                     NULL                      NULL
00002  2012-10-02 00:00:00.000   2012-10-02 07:35:00.000  2012-10-02 20:12:00.000   NULL
00003  2012-10-02 00:00:00.000   2012-10-02 13:00:00.000  2012-10-02 17:00:00.000   3 
00004  2012-10-02 00:00:00.000   NULL                     NULL                      3
00005  2012-10-02 00:00:00.000   2012-10-02 07:13:00.000  2012-10-02 19:24:00.000   NULL
00006  2012-10-02 00:00:00.000   2012-10-02 07:55:00.000  2012-10-02 20:58:00.000   NULL

i need update from Table LeaveEmp only.

Thanks you fou your time. 🙂

  • 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-14T03:21:45+00:00Added an answer on June 14, 2026 at 3:21 am

    You are missing a link between modifyTime and LeaveEmp… try this

    UPDATE modifyTime
    SET ErrCode = '3'
    FROM modifyTime m
    INNER JOIN LeaveEmp l
      ON m.EmpNo = l.EmpRun
    WHERE l.Start = '2012-10-02' and modifyTime.cDate = '2012-10-02'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to update my .htaccess file to redirect permanently all URLs from http://example.com/pages/5604/article/something/?page=299
I have a table in mnesia and I need to update individual fields in
I need to run a save/update query but only update those fields that aren't
I am trying to update database fields from one SQL Server table to another.
I need to update a table from a temporary table. Therefore I need to
I need to update my table because a number of fields in a column
In one table I have fields cat_id, cat_name the table I need to update
I need to query a database table then write 3 of the 4 fields
I need to update all fields except property1 and property2 for the given entity
I need to update a record in a database with the following fields [ID]

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.