4158 0
Stored procedure in sql server (With Example)
In this article, I have explained basics and important points to understand stored procedure in sql server with examples.
Type
Article
63 0
Download and Install SQL Server (Step by Step procedure)
In this article, I have provided the guide to download and install sql server database on your machine with step by step procedure.
Type
Article
74 0
SUM and JOIN 2 columns with different tables but do not SUM Qty

Good day!

Need help to SUM and JOIN 2 columns with different tables but do no want to SUM qty and duplicates row result

here's the sample data tables;

 

Transfer Shipment table;

TransTO - TransFROM -  ItemNo   -   Desc   -   Desc2   -   VariantCode   -   Qty

Location1      HO                Item01         Active      Black         Variant01             5           <------ Delivery

Location1      HO                 Item01         Active      Black        Variant01             5           <------ Delivery

HO                Location1       Item01         Active     Black        Variant01             2          <------ Pull-out

HO                Location1       Item01         Active      Black       Variant01             1            <------ Pull-out

 

Sales Entry table;

Loc Code   -   Item No   -   Variant Code   -   Qty

Location1       Item01          Variant01            -1       <------ PSales

Location1       Item01          Variant01            -1       <------ PSales

 

Item Entry table;

Loc Code   -   Item No   -   Desc   -   Desc2- VariantCode-   Qty - EntryType  - DocNo

Location1       Item01         Active     Black         Variant01      4         2           ItemAdj0001   <------ PAdj

Location1       Item01         Active     Black         Variant01      1          2           StrAdj0001       <------ PAdj

Location1       Item01         Active     Black         Variant01     -1          1           MSales0001     <------ MSales

Location1       Item01         Active     Black         Variant01     -1           1           MSales0002     <------ MSales

Location1       Item01         Active     Black         Variant01     -1          3           LocAdj0005      <------ NAdj

Location1       Item01         Active     Black         Variant01     -1          3           BtqAdj0008      <------ NAdj

 

SUM and JOIN (the sql query result should be like this)

Loc Code  - Item No - Desc  - Desc2 -VarCode- Delivery -PAdj- Pull-out - PSales - MSales - NAdj  -  Total

Location1    Item01   Active    Black   Variant01     10            5           3             -2             -2         -2            6

 

here's my sql query code;

...
Type
Question
77 1
Cannot connect to WMI Provider SQL server configuration manager error

I am trying to open SQL server configuration manager, after following this question "How to open sql server configuration manager in windows 10?" and steps to show it on Start menu, but when opening configuration manager getting error pop-up with message

Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager.
Invalid namespace

...

Type
Question
132 4
SUM and JOIN 2 columns with different tables but it duplicates results

Trying to SUM and JOIN 2 columns with different tables but it duplicates results, here is my query

...
Type
Question

3107 0
Difference between Stored procedure and function in SQL Server
This article, lists important difference difference between Stored procedure and function in SQL Server after giving brief details about Stored procedures and functions (user-defined functions) in SQL server.
Type
Article
2734 0
How to check sql server version? (Various ways explained)
In this article, I am going to provide you various possible ways to check SQL server version, by following these simple steps.
Type
Article
416 0
Query in Sql server to list all stored procedures in all databases
In this short article, I have provided simple query using which we can list all stored procedures in all database of SQL server or all stored procedures of specific database.
Type
Article
10513 0
SQL server connection string examples in C# & XML
In this article, I have provided various examples of SQL server connection string in C#, ASP.NET Web.Config file in XML format and MySQL connection string in C#.
Type
Article
1129 0
Import csv into SQL server (with query OR without query using SSMS)
In this article, I have explained how you can import data from csv file into sql server using query and without query import csv into database using SQL server management studio.
Type
Article

Page 1 of 6