Questions tagged as 'sql-server-2012'

2
answers

Add php and SQL server

Hi, I'm working php with sql server and I need some help with the following: I have this query $sql = "select saldo_final from cuentas where doc = '1098788811'"; $consulta = sqlsrv_query($conn, $sql); while($datos = sqlsrv_fetch_array($co...
asked by 27.07.2018 / 00:02
1
answer

Update data with spaces in sql server

I have a database, with a couple of tables in which I have stored many records that have been brought from another database. My big drawback is that the data has passed with spaces, before the actual data, it seems that sql server will take t...
asked by 11.04.2018 / 23:45
3
answers

How to join 3 queries in sql?

How can I show the following 3 queries in a single selection? select Top 1 NumOperador, Rendimiento, SdFecha from trfRendimientos where (NumOperador = @NumOperador OR @NumOperador = 0) and (MONTH(SdFecha)= month(@FechaDesde) and YEAR(SdFec...
asked by 20.07.2017 / 17:02
1
answer

Formatting result in SQL display '000025' instead of 25

I have a table with the following structure: ID MONTH 21714 JAN 76101 JAN 175187 FEB 243575 APR 299116 JUN 304742 JUN I need to generate a string of 14 characters for each record similar to 'ABC00...
asked by 12.10.2017 / 17:21
2
answers

Query with data grouped by time, whether it exists or not

Currently I have to make a report based on a query, the query that is made should return all stoppages that have occurred in a range of determined dates every five minutes, if there is a record that meets that condition for that interval should...
asked by 07.08.2017 / 12:28
2
answers

convert rows to columns in sql 2012 [closed]

hi how are I have this query SELECT nom_emp, ISNULL (LENTES,0)[LENTE], Fecha_Gestion, ISNULL (AYUDA_ODONTOLOGICA,0)[AYUDA ODONTOLOGICA], Fecha_Gestion FROM (SELECT me.nom_emp,Fecha_Gestion,TB.Tipo_Benef,Monto F...
asked by 07.03.2017 / 16:12
1
answer

Trigger SQL Server insert record and update a field from another table

I have two tables:    tblProducts -Id int, -Producto varchar(10), -Cantidad int    tblVentas -Idventa -Idproducto -Cantidad int The tblProductos table is related to tblVentas. What I want to realize is that when the sale...
asked by 14.03.2018 / 07:14
1
answer

Error using bcp command with xp_cmdshell

I am trying to use the command bcp by means of a query with xp_cmdshell the problem when executing it I skipped an error of Unable to open the file. But if I execute the same by command lines it works perfectly. The user I'm using has sysadmin p...
asked by 16.11.2017 / 09:49
1
answer

SQL query error when executing

I am trying to make a query in SQL Server in which I do: Round(Convert(float,A)/(Convert(float,B),2) and you return this message:    The conversion of the nvarchar value '2968922618' overflowed an int column. The value of the denomin...
asked by 22.02.2017 / 16:17
1
answer

Validate absences with php

Hi chic @ s I have a question about how to show a data that does not exist in the database ... I explain I have an arrangement in which I keep the students' attendance which is separated by id, date, entry and exit $ fecha2 is a validation to fi...
asked by 13.11.2018 / 23:07