Questions tagged as 'sql-server'

2
answers

Searches conditioned to sql from c #

C # does not want to read the code, it marks me completely as an error, I do not know if it's because of the way I'm locking up each case. the dtpdesde and dtphasta are controls DateTimePicker txtbusqueda and...
asked by 04.07.2017 / 18:49
2
answers

Put two results together in the same table

I'm trying to get two different queries together in the same table: declare @semana nvarchar(10) set @semana=(select datepart(week,getdate())) select SUM(CANTIDAD) AS Qty1 from tbl_Entrada where dia=('Monday') and semana=@semana...
asked by 03.07.2017 / 22:51
1
answer

Subtraction of 2 sums in sql

I have this query SELECT t.SI_Articulo, m.SI_Descripcion, t.SI_UM, CASE WHEN c.SI_OV IS NOT NULL THEN '*' ELSE NULL END SI_OV, (COUNT(DISTINCT t.SI_Ubicacion)) SI_Ubicacion, (SUM(DISTIN...
asked by 03.07.2017 / 20:04
2
answers

TSQL How can I create a field that depends on another

I have a problem in TSQL that I do not know how to do it, I explain I have to create a field that takes the date of another field and adds 3 years, is there any way to do this directly in the field without inserting it?     
asked by 13.06.2017 / 18:43
2
answers

Error programming a JOB in SQL Server 2008

I am programming a JOB ( DEPURACION_TRAMITE ) on a Remote server, I get the following result ( not programmed ) in this field: Next Execution seen from the monitor of JOB's : It's just dead, there are no execution error messages, it...
asked by 16.06.2017 / 00:08
2
answers

Show SQL result as integer

The human resources department needs to show the employee number, last name, salary and salary increased by 10.5% (expressed as a whole number) of each employee. I labeled the column as New Salary . I do it like this: SELECT [numero d...
asked by 13.06.2017 / 18:17
1
answer

Update records using a TRIGGER FOR DELETE using SQL Server

I want to make a trigger that as soon as I make a dismissal to the rest of the employees I raise the salary by 20%, but I do not know how to operate directly with the cursor explícito in this trigger , since the query would g...
asked by 14.02.2017 / 23:03
2
answers

Winforms C # connection with remote SQL Server

I am developing an application with winforms which I need to connect to a remote server to share the data in an intranet to different machines. The point is that I only want to install the SQL Server on the server and that the other PCs conne...
asked by 22.11.2016 / 14:58
1
answer

query sql error when converting to type time?

I have the following query SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,(DATEDIFF(HOUR,[Hora Salida],[Registro Salida]))),2) + ':' + LEFT(CONVERT(VARCHAR,DATEDIFF(MINUTE,[Hora Salida],[Registro Salida])),2) + ':00') but when I try to execute i...
asked by 19.01.2018 / 13:24
3
answers

SQL Query-Repeated Data

Good! I have two tables ( VOIPCLIENTE , VOIPMAQUINA ) where in VOIPCLIENTE I have information about the clients ( CLIENTE,DELEGACIÓN... ) and in VOIMPAQUINA on the machines ( MAQUINA,EMPRESA... ). These t...
asked by 29.11.2016 / 09:45