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 8245779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:17:46+00:00 2026-06-07T22:17:46+00:00

I have a situation where in I have to combine two tables without losing

  • 0

I have a situation where in I have to combine two tables without losing any data. The two tables have different structures. Following is the structures of my tables

TABLE A 
ID_NO INT,
Ship_Date DATE,
Status varchar(10),
total decimal(12,2)

TABLE B
ID_NO INT,
Status varchar(10),
total decimal(12,2)

I tried using UNION ALL by including a dummy column in TABLE B as follows

TABLE B
ID_NO INT,
'',
Status varchar(10),
total decimal(12,2)

but in the result set i get 1900-01-01 as Ship_Date instead of ”. How to eliminate this?

  • 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-07T22:17:49+00:00Added an answer on June 7, 2026 at 10:17 pm

    Use a NULL value instead of an empty string. If you don’t mind the Ship_Date result as a string, then you can wrap the UNION in another select statement.

    SELECT U._ID_NO, 
           CASE WHEN U.Ship_Date IS NULL 
                   THEN ''
                   ELSE CONVERT(NVARCHAR(50), U.Ship_Date,101) END AS Ship_Date,
           U.Status, 
           U.total 
    FROM
    (
      SELECT A.ID_NO, A.Ship_Date, A.Status, A.total 
      FROM TableA
    
      UNION ALL
    
      SELECT B.ID_NO, NULL AS Ship_Date, B.Status, B.total 
      FROM TableB
    ) AS U
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables a main table and a work in progress table. Any
I have two different tables trackingevent and link Trackingevent looks like eventName|eventStamp SHARE_FACEBOOK|2011-01-20 14:05:40
I have situation where a user can manipulate a large set of data (presented
I have a situation where I have two arrays and I use one array(A)
I have basic tables one and two. Let`s call them tbl1 and tbl2. tbl1
Here's the situation: In my database i have a table with threads, and a
I have a issue where I need to combine a bunch of duplicate data.
Imagine you have the following situation: for i in xrange(100000): account = Account() account.foo
I have a column which value is combine two elements, Just like Class_Name。For example
i have situation like this: class IData { virtual void get() = 0; virtual

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.