Questions tagged as 'sql-server'

0
answers

Error in Linq query

I have a DropDownList with which I want to bring the records according to the item selected, when I click on the search button I get the following error:    The entity or complex type 'DB_ALMACENModel.Product' can not be   const...
asked by 18.07.2018 / 06:10
0
answers

Filter By Dates in SQL

I have a somewhat confusing problem. First: I want to know how many days of payment correspond to a person according to their assistance within the current period. Table usuarios : id Nombre fecha_ingreso 1 Juan 01-01-2018...
asked by 16.08.2018 / 18:21
0
answers

Warning: sqlsrv_fetch_array () expects parameter 1 to be resource, boolean given in

I have a form that enters people, but I have problems validating using sqlsrv_num_rows() the error is as follows:    Warning: sqlsrv_num_rows () expects parameter 1 to be resource, boolean given in <?php include "conexion.php"; f...
asked by 09.07.2018 / 23:49
1
answer

Get the last average monthly price of each product

I want to obtain from each product the average price of the last month that each product was sold. A problem is generated in the second temporary table "price_avg" because when you change the calculation from avg (punitdolar) to price_ultimoUSD...
asked by 04.07.2018 / 21:41
1
answer

Two submit to Edit and Insert in the same Form

This is my form: <form name='form_update' method='post' id="registerUser" action='update.php'> <input type='text' class='form-control' name='nombre' value=<?=$nombre; ?> /> <input type='text' class='form-control' name='ne...
asked by 13.07.2018 / 20:35
1
answer

Because I can not insert data in this SqlExpress 2014 table

Good morning friends I am trying to insert in a table of sqlexpress 2014 values, however this message appears to me who could help me I'm making this table create table EMP ( EMPNO int primary key not null, ENAME varchar(50) not null, JOB var...
asked by 23.06.2018 / 16:32
0
answers

AVERAGE CALCULATION OF DAYS WITH TWO FIELDS DATE

Cordial greeting, How can you calculate the average between dates in sql server and try the following: SELECT SUM((DATEDIFF(DAY,HPNESTANC.HESFECING,HPNESTANC.HESFECSAL))) FROM HPNESTANC WHERE HPNESTANC.HPNDEFCAM IN (80,237, 238,239,240,2...
asked by 05.07.2018 / 23:30
1
answer

Duplicate records in SQL query

Holas I have the following query in SQL Server: SELECT P.ProyId, P.ProyCodigoSNIP, P.Proyecto, E.EtapaAbr FROM PROYECTO AS P, PROYECTO_ETAPA AS PE, ETAPAS AS E WHERE P.ProyId=PE.ProyId AND PE.ProyEtapa=E.EtapaId As you can see, I consult 3...
asked by 27.06.2018 / 07:22
2
answers

How to join data from one table to another that have the same identifier?

create table usuarioEmpleado( id_empleado int not null primary key, id_tipo int not null references tipoUsuario(id_tipo), nombres varchar(150) not null, apellidos varchar(150) not null, telefono int not null, correo_electronico varchar(70) not nu...
asked by 23.05.2018 / 19:51
1
answer

Insert correlative to an ID field in SQL

I'm currently making an export with this Script: /* FromTable 1:Otrntransaction, 2:OtrnTrnTaxAmount, 3:Marckup */ SELECT '1' AS FromTable, T1.ID_Trn AS IdDiarioTrans, T1.PostingDate AS Fecha, T2.AccountNo AS Folio,...
asked by 07.06.2018 / 19:40