We help IT Professionals succeed at work.
Get Started

SQL Server, merging Views

630 Views
Last Modified: 2012-08-21
I have been working a lengthy custom project revolving around custom VB apps and a SQL database.

I’m nearing the end and I have hit a brick wall.

I have created two views with data I need to populate my final report with.

The first view is Aquisition records, the second is disposition records.

For simplicity, each view has  columns as follows

Aquisition View
Serial_Number, Aquire_From, Aquire_Date

Disposition View
Serial_Number, Disposed_To, Disposed_Date

These views keep track of our Serialized Product during the production process.  A serial number can travel several times between the plant, vendors, or customer returns. So there can be multiple entries in each view for the same number.

I would like to be able to merge these two views into a report as in the attached sample.

AS you see a serial number can have multiple transactions before being sold.  If a serial number hasn’t been sold yet or no disposition has been made against it yet, the disposition is blank and is considered in our inventory.

Every transaction has a date associated with it (date/time to the millisecond). I haven’t been able to match records up to achieve this report yet.

Please let me know if more info is required.
Thank you.
sqlmerge.pdf
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE