2,736 Topics

Member Avatar for
Member Avatar for Trench37716

I am calling data from my database but the result is not what I want. Below is my code: Select distinct concat(ImporterDistributor.name, '/', ID.name) as [Distributor_Importer], case when Product_Delivery.Product=1 then isnull(max(Product_Delivery.Opening),0) end as OpeningPMS, case when Product_Delivery.Product=2 then isnull(max(Product_Delivery.Opening),0) end as OpeningAGO, case when Product_Delivery.Product=3 then isnull(max(Product_Delivery.Opening),0) end as OpeningATK …

Member Avatar for Trench37716
0
199
Member Avatar for Joemeister

I am quite new to SQL but I was wondering how to achieve the following. How do I get specific values that fall in the year 2013 when the date format in the table is looking something like this: 1 94 pH 02-02-2012 11:48 AM 1200001 2 103 pH 09-06-2012 …

Member Avatar for Reverend Jim
0
171
Member Avatar for Joemeister

I want to know how to achieve the following: I want to convert a varchar to a date format but so far I'm not very successfull... My date (varchar) looks something like this: 02-02-2012 11:48 AM And I want to convert it to the following this: dd-mm-yyyy To be able …

Member Avatar for Joemeister
0
289
Member Avatar for jeffcogswell

Every year or so for the past couple of decades I've seen new products appear that claim to let you create software without having to know how to code. And every time the next one comes out, I roll my eyes, because they always fail to deliver as promised. Usually …

Member Avatar for Jerry_10
0
632
Member Avatar for jean_5

I have the following view: ALTER VIEW [dbo].[vw_RelInclusaoGeralCivil] AS SELECT DISTINCT m.Nome AS MunicipioNome, au.Nome UsuarioNome, s.TipoId AS SolicitacaoTipoId FROM Solicitacao s INNER JOIN Unidade u ON s.UnidadeEntregaId = u.Id INNER JOIN Endereco e ON u.EnderecoId = e.Id INNER JOIN [IBGE.Municipio] m ON e.CodMunicipio = m.CodMunicipio INNER JOIN Terminal t …

Member Avatar for bnmng
0
267
Member Avatar for jotungiya

Split pipe delimited into new columns as below : col1 col2 col3 col4 Data|7-8|5 Data 7-8 5 Data|asdsad|sad Data asdsad sad fish|c cx cx xc cc xc cx |ededededeed fish c cx cx xc cc xc cx ededededeed Data|iueroiheqroqer|ewoijewijewd5 Data iueroiheqroqer ewoijewijewd5 tune||5 tune 5 Data|| Data check http://stackoverflow.com/questions/19688863/split-pipe-delimited-into-new-columns

Member Avatar for djjeavons
0
222
Member Avatar for adam.reilly.148

I wrote a program in early 2010 that ran a command line function that pulled data from SQL Server 2005. The program worked at the time, but does not seem to work now (for various reasons, it was not used for about a 1 year). BCP "EXEC emdb..Patch2" QUERYOUT D:\shares\patch2.txt …

Member Avatar for Reverend Jim
0
92
Member Avatar for ahmedsa

Hi guys I have problem i need to make ERD relation entity between employee and allowance Employee table Name address Basic Salary Bonus Allowance table House rent Food Allowance Moving Allowance Basic Salary is monthly and fixed Bonus is monthly and fixed food allowance is monthly and fixed for married …

Member Avatar for diafol
0
262
Member Avatar for Lethugs

Hi, I originally created this query to get a result from a single select statement Its funny that it became a very long query having sets of joined table Its also maybe annoying to look for it so im trying to trim it down most of it have same joined …

Member Avatar for Lethugs
0
325
Member Avatar for rpv_sen

Hi I am having two textbox, textbox1 is having autosuggest feature. i want to display related value based on textbox1 value. can any one pls help me. i collected the code from internet **Output Example** Report Name : PHP Report Version: It has to display the Verison from the database. …

Member Avatar for rpv_sen
1
458
Member Avatar for Niro800

Hello... Can anybody explain me Ebay or something like that database structur.Do All Item Categoris Store in One Table(with Differnt types)or do they story in many table .ex books for one table,jewellery in another table and so on.if they are store in differnt tables how do we search them ? …

Member Avatar for Traevel
0
1K
Member Avatar for djblois

I am trying to look on the web for a way to create a stored procedure that I can run and then put in multile values and this is the closest I can find: CREATE TYPE dbo.EmployeeList AS TABLE ( EmployeeID INT ); GO CREATE PROCEDURE dbo.DoSomethingWithEmployees @List AS dbo.EmployeeList …

Member Avatar for hericles
0
135
Member Avatar for jean_5

I have the following table: Region IdDescription IdUser Metropolitan Right 5 Metropolitan Left 6 Metropolitan Right 5 Metropolitan Left 6 Country Town Right 5 Country Town Left 6 Country Town Right 5 Country Town Left 6 Metropolitan Right 7 Country Town Left 8 And I want to query the kinds …

Member Avatar for Taywin
0
104
Member Avatar for Violet_82

Hi guys, I hope this is the right section to post. I need to develop an application in visual studio 2012 that uses SQL (please bear with me as I'm not very well versed in databases and SQL and therefore I don't know what SQL visual studio uses), and when …

Member Avatar for Violet_82
0
577
Member Avatar for Maideen

Hi I have an issue in store procedure. Error is Msg 4104, Level 16, State 1, Procedure W_usp_SO_Table, Line 38 The multi-part identifier "dbo.SVendorMaster.SVCode" could not be bound. Insert table is working fine. But update command is prompt the error Pls advice me Maideen Here is SP SET ANSI_NULLS ON …

Member Avatar for hiren2927
0
697
Member Avatar for Maideen

Hi I do not know how to sum the one of the column in #table temp table It is my SP SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[usp_Customer_Due_Until_Now] @Code nvarchar(30) AS BEGIN SET NOCOUNT ON; select code as Code, Name as Name, sum(Nett) SINETT into #tableSI …

Member Avatar for ExpertMind
0
2K
Member Avatar for Jesi523

Hello, I need a little help with trigger, I have been doing database development for a long time now but this is my first go around at a trigger. It is not working, can someone please look at this and let me know what I am doing wrong: ALTER TRIGGER …

Member Avatar for Dani
0
196
Member Avatar for Amr_Mohammad_R

I need to know if there is a way to improve the below function as it takes long execution time UserDefinedFunction [dbo].[GetChildrenAccount] SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER FUNCTION [dbo].[GetChildrenAccount] (@AccountID INT, @DateFrom DATETIME, @DateTo DATETIME, @TypeTransaction INT, @Currnecy INT, @Branch INT) RETURNS DECIMAL(18,3) AS BEGIN DECLARE …

0
103
Member Avatar for Lethugs

Hi, Im trying to extract data from sql server where conditions are multiple and variying I have a datagridview with 2 columns ID and Name I need to create Select Query to extract data where condition is 'ID should be equal to the value or values in Datagridview ID Column. …

Member Avatar for Lethugs
0
267
Member Avatar for amishraa

Is there a way to get a total counts from the resultset of two unions? This will be for DB2. select count(*) from ( select count(*) from xyz where abc='1' union all select count(*) from x1y1z1 where abc='1' )

Member Avatar for amishraa
0
177
Member Avatar for morfious90

I'm implement if else in stored procedure with and oprator . If both Conditions are true the if statement should return 1 else -1. here username and email should not be duplicate please review query below. alter proc spUserdetailss @name Nvarchar(50), @passwords Nvarchar(100), @emailadd Nvarchar(50), @Gender nvarchar(50) as begin declare …

Member Avatar for pclfw
0
414
Member Avatar for Amr_Mohammad_R

This function I have created to return all recorded Stock numbers in the Table "ContributorDeeds" the table contains only the start number of the stocks and the end number of the stocks (e.g, from number - to number) I need to get all the numbers between within that range. The …

Member Avatar for Taywin
0
227
Member Avatar for rony001

hello friends I have two tables with column A and column B. I want to update column B of table2 with column B of table1 . I have trying this query in ms access from Vb.net. update table1 t1 LEFT JOIN table2 t2 on t1.a = t2.a SET t2.b = …

Member Avatar for isozworld
0
280
Member Avatar for G_Waddell

Hi, I have to correct some data in SQL Server 2008 R2 database for an accounting system that was accidently over written. Basically I've to take stock items with fixed prices and compare those fixed prices against Sales Order Transactions for the stock item and correct entries where the transaction …

Member Avatar for isozworld
0
158
Member Avatar for jarp

I have written a SQL query to find product information in a c# program and it doesn't seem to work at all! I have tested a variety of other queries with my C# code and it works fine, but this throws an exception every time. SELECT TOP (1) CONVERT(varchar, tmpRptAssetEvent.EventTimeStamp, …

Member Avatar for BitBlt
0
202
Member Avatar for Maideen

Hi I have an issue in below stored procedure. below Store procedure is working fine. But fixed the Year. Any one know How can do the year dynamically select by user? SELECT * FROM ( SELECT salesEXE,SalesEXEName,name,gross,YearNo FROM vw_Pivot_Month_ALL) TableYearNo pivot (Sum(gross) for [yearno] in ([2008],[2009],[2010],[2011],[2012],[2013],[2014],[2015],[2016],[2017],[2018],[2019],[2020]) )pivotTable pls advice Maideen

Member Avatar for isozworld
0
280
Member Avatar for AmrMohammed

Greetings, I'm facing a problem with the SQL Server and this problem concerning numbers when compared each other and these numbers are stored in the columns of data type NVARCHAR or VARCHAR. For example, if I'm having a column with data type NVARCHAR and it contains such values: 1 2 …

Member Avatar for isozworld
0
265
Member Avatar for Gaurav arora

Hi all, I have created a table in which i have a DateTime Column . i need that i dont want to insert values in that column from the front end. i have created a trigger for that purpose. whenever i insert a row in that table the dateTime column …

Member Avatar for Timothy_3
0
212
Member Avatar for Amr_Mohammad_R

What is meant by the bold part of the below paragraph An index is a copy of select columns of data from a table that **can be searched very efficiently that also includes a low-level disk block address** or direct link to the complete row of data it was copied …

Member Avatar for pritaeas
0
82
Member Avatar for spowel4

I have this query as part of a stored procedure, and this query as it is listed here works: INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 8.0;Database=G:\KF\GBSData.xls;', 'SELECT * FROM [Sheet1$]') SELECT * FROM [KWF_GBSData].[dbo].[tblKWF_WorkTable2] WHERE invoiceNumber IN ( SELECT invoiceNumber FROM [KWF_GBSData].[dbo].[tblKWF_WorkTable2] WHERE stockNumberShipped LIKE 'CCCOMBO%' ) I would like to change …

Member Avatar for askme_1
0
555

The End.