Questions tagged as 'tsql'

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
1
answer

Trigger to subtract dates

Hello colleagues I have this query that works well to find the difference between two dates in days, hours, minutes and seconds but when I pass it to the trigger it does not work anymore I get a number 4873 I do not know what I'm doing wrong, my...
asked by 05.07.2017 / 16:20
1
answer

SQL - Filter by range dates with double column

Hi, I have a problem with a query. I want to filter by date ranges with two columns. Start and End. X | Inicio | Fin 1 |2018-10-01 | 2018-10-31 2 |2018-11-01 | 2018-11-30 3 |2018-11-15 | 2018-12-15 Inicio BETWEEN @parametroInicial...
asked by 23.11.2018 / 17:14
0
answers

Get a particular date for each SQL ID

I am trying to get the next available date from a calculation that I show acontinuacion. That's the query I'm using but it does not work. SELECT DateID = ROW_NUMBER() over (order by B.Date_Key) ,C.FundDate FROM DIM_DATE B LEFT JOIN DIM_St...
asked by 25.06.2018 / 19:12
0
answers

Subtracting a next value based on a condition in the same SQL column

I need to create a query that every time I find a value "Sent" in the Status column, then subtract it in the Events column taking into account a next value that is after Sent. Table that I am using: Catalogo Status Eventos ------...
asked by 09.07.2018 / 19:30
1
answer

insert time type data in sql server

I'm making a data set for an application, and when I insert a Time record, it gives me the following error: INSERT INTO [ope_prodqa_dev] ( staff, turn, date_prodqa, hour_dev ) VALUES ( 1, 4...
asked by 19.06.2018 / 10:21
0
answers

query or cursor in mysql

As you can see I do not want to show me data for the month of April 2018 but if there are records for the month of April, if there is a date for the month of April, discard that paritemcod and  go to the next one because there are 20 paritemcod...
asked by 12.06.2018 / 17:31
1
answer

Add or subtract one column based on the value of another and making cut by ID

I have a table called Registers with this structure: What I do is add a new column to the right where a balance is going to be calculated (either add or subtract) based on the value of each record in the Concept column; something like t...
asked by 24.01.2018 / 00:31
1
answer

How to make INNER JOIN between a table in SQL SERVER and a linked server?

Well I mean, I have a database in SQL SERVER called SIELAB and another database in PostgreSQL called reservations , I managed to make the connection correctly and I have already managed to execute a SELECT query from a stored procedure...
asked by 17.08.2017 / 04:20
2
answers

Inconsistency in query result "isnull (column, '') returns a space"

During the process of producing a solution in C # records were saved forming a "folio" with a literal, a cell value and an id 'C'+ISNULL(Columna1,'')+Columna2 Example of result: C96 CX85 The queries have not changed, the same database...
asked by 27.07.2017 / 17:43