fix a ms sql query

I need a query for get some informations from Ms Sql, but for privacy requirements, i can't give you access to datatabase. However i can give you two queries that working right where you can get the table names required


Select MGGiacDisp.Cd_AR,[url removed, login to view],cast(format(Sum([url removed, login to view]), \'N\', \'it-it\') as varchar(20)) AS TotaleQuantita From MGDisp('+AnnoCorrente+') MGGiacDisp Inner Join AR On MGGiacDisp.Cd_AR = AR.Cd_AR Inner Join ARARMisura On AR.Cd_AR = ARARMisura.Cd_AR And [url removed, login to view] = 1 WHERE MGGiacDisp.Cd_MG IN (\'00020\',\'0001\') GROUP BY MGGiacDisp.Cd_AR,[url removed, login to view] ORDER BY MGGiacDisp.Cd_AR


SELECT [dbo].[AR].[Cd_AR], [dbo].[AR].[Descrizione], cast(format([TabGiacenza].[Quantita], \'N\', \'it-it\') as varchar(20)), [ARLotto].[DataScadenza], [TabGiacenza].[Cd_ARLotto], [MG].[Descrizione] FROM [dbo].[MGDispEx] (2017) AS TabGiacenza INNER JOIN [dbo].[AR] ON [TabGiacenza].[Cd_AR] = [dbo].[AR].[Cd_AR] LEFT JOIN ARLotto ON [TabGiacenza].[Cd_ARLotto] = [ARLotto].[Cd_ARLotto] AND [TabGiacenza].[Cd_AR] = [ARLotto].[Cd_AR] INNER JOIN [dbo].[MG] ON [TabGiacenza].[Cd_MG] = [dbo].[MG].[CD_MG]

The goal is take the first one query and add this condition

. Where TotaleQuantita < 0

and Select also

. MGGiacDisp.Cd_MG

I done this query but it doesnt' working

SELECT MGGiacDisp.Cd_AR, [url removed, login to view], MGGiacDisp.Cd_MG, cast(format(Sum([url removed, login to view]), \'N\', \'it-it\') AS varchar(20)) AS TotaleQuantita FROM MGDisp('+AnnoCorrente+') MGGiacDisp INNER JOIN AR ON MGGiacDisp.Cd_AR = AR.Cd_AR INNER JOIN ARARMisura On AR.Cd_AR = ARARMisura.Cd_AR AND [url removed, login to view] = 1 WHERE MGGiacDisp.Cd_MG IN (\'00020\',\'0001\') AND TotaleQuantita < 0 GROUP BY MGGiacDisp.Cd_AR,[url removed, login to view] ORDER BY MGGiacDisp.Cd_AR');

Evner: Microsoft SQL Server

Se mere: bad subdomain sql query prestashop fix, fix bad subdomain sql query prestashop, bad subdomain sql query error fix, fix bad subdomain sql query, ms sql query mysql convert, convert ms sql query mysql, design sql query forum tree, sql query find number child elements, specialise sql query, getafreelancer message sql query help needed, sql query tree children, sql query tree structure, sql query child child, asterisk call forward database sql query, sql query tree structure records

Om arbejdsgiveren:
( 90 bedømmelser ) Villanova Mondovì, Italy

Projekt ID: #15399742

Tildelt til:


Hi, I have good proficiency in sql server. I would like to make your third query work. ............................

€9 EUR på 1 dag
(17 bedømmelser)

3 freelancers are bidding on average €15 for this job

€23 EUR in 3 dage
(0 bedømmelser)

Are you online now to work together on the issue? Please ping if you are online. Can work now with you.

€14 EUR på 1 dag
(0 bedømmelser)