Questions tagged as 'sql-server'

2
answers

how can I change the varchar length of varchar from (30) to (70) in sql [closed]

create table catalogo (nodecuenta varchar (12) primary key, descripcion varchar (40) not null)     
asked by 30.10.2018 / 03:02
1
answer

SQL current time stamp Where you select a specific day from the month before the present

I am looking for a way to compare a data from my table in SQL server to get the list of records from a date SELECT * FROM asistencias where fecha >= (CURRENT_TIMESTAMP-15) (shows the current results of the current date -15 days) my...
asked by 30.07.2018 / 23:30
2
answers

Operation to get SQL percentage

I have the following query: SELECT (CONVERT(FLOAT,22*100) / 148) With it I get a percentage = 14.8648648648649 This percentage I have to show in my web application but in the following way, percentage = 14.86, only showing the last two d...
asked by 30.07.2018 / 21:56
1
answer

SQL While traversing a table

Friends I'm trying to run a table from SQL but for some reason I do not get the data for each row of my table. Can someone tell me what I'm doing wrong? declare @count int = 0, @countb int = 1 set @count = (select count( * ) from sta...
asked by 22.08.2018 / 22:34
1
answer

Inner Join Sql for a query of two tables

Hello friends I'm trying to make a query where I get elements from different tables, in this case, it's only for 2, I guess I can use a Inner Join but from what I understand this I It serves to relate tables. This is more or less what I want ....
asked by 18.06.2018 / 18:58
2
answers

Multiple data in where variables in SQL

Well, I'll tell you a little bit. I have a query in SQL like the following > SELECT * FROM TABLA WHERE Priority <> 'P1' AND Region = ISNULL(@Region,Region) AND PM_Name = ISNULL(@PM,PM_Name) AND Priority = ISNULL(@Priority, Priority)...
asked by 21.11.2018 / 16:16
2
answers

Multiply an alias with a field in SQL

I have this query and I need to multiply SI_Dif * m.SI_Costo_Promedio but it tells me that SI_Dif is not valid. SELECT t.SI_Articulo, m.SI_Descripcion, t.SI_UM, (CASE WHEN c.SI_OV IS NOT NULL THEN '*' ELSE NULL END) AS SI_OV,...
asked by 23.06.2017 / 18:55
1
answer

Extract the value of an Item from a DropDownList that is filled with a sql server C # query and aspx

I have a DropDownList called Sale that I fill in as follows: DataRow fila = dtr.Rows[0]; OdbcCommand cmd = new OdbcCommand("SELECT A.CardCode, A.CardName, B.SlpName FROM OCRD A INNER JOIN OSLP B ON A.SlpCode = B.SlpCode WHERE B.SlpCode ='"...
asked by 29.06.2018 / 19:28
1
answer

Update field of two sql server tables

I present the following concern, I need to make an update of the initial amount in the article table, brought from the table articulo18abril as a condition I have established that if they have the same id is assigned the amount that corresponds...
asked by 19.04.2018 / 23:17
1
answer

How to show only part of a string in sql server?

I have a table and in this one, a post column. What I need is for a query to show only the domains, that is, hotmail.com , gmail.com , etc .. SELECT correo FROM cliente     
asked by 01.03.2018 / 22:06