Questions tagged as 'sql-server'

2
answers

SQL Sort by ID and value in 2 different tables

Currently I need to make a query to 2 tables where the data have several equal columns. The problem is that the ordering must be done based on how the order of table A is structured, but at the same time taking the value of the ValueOrder column...
asked by 05.05.2016 / 22:46
1
answer

SQL Constrain to insert the current date in the column but it leaves 1900-01-01

When I want to insert a student, I want to insert the current date automatically with the constrain in Date-Registration. ALTER table TB_ALUMNO ADD CONSTRAIT FECH_MATRI_ALU DEFAULT GETDATE() FOR FECH_MATRI_ALU GO I get 1900-01-01 instead o...
asked by 01.12.2018 / 07:00
2
answers

How to restrict the value of one column with respect to another in a table in SQL?

I have the following table: Clientes ( Nombre varchar(50) not null, Id_Cliente varchar(15) primary key, Telefono varchar(15) not null unique, Edad int not null, Email varchar(50) not null unique, Deudor bit not null def...
asked by 18.04.2018 / 03:20
2
answers

Get current value in real time in table

I have the following problem, I am currently working on a pricing system with SQL Server database, in which I have to work Dynamic pricing . For which I have the following table. ID_TARIFA : Primary Key Auto-increment. I...
asked by 26.10.2016 / 04:24
1
answer

Stored procedure does not run completely when I call it from PHP

I'm having a very serious problem because it does not let me continue with the project I'm developing. The logic is as follows, I upload a file of Excel to the server (from a web system) then I read the data that is in the file of E...
asked by 22.04.2016 / 16:11
1
answer

SQL Check between date range - but a date may be NULL

Good day community. I need to make a query in SQL (Sql Server 2012) to filter by a range of dates (Start Date - Term Date). The table is as follows: DETENTIONS ID ESTADO EQUIPO FECHAINICIO FECHATERMINO The Problem, is that some...
asked by 04.09.2017 / 16:26
7
answers

Get only month and day using SELECT in SQL server

Use SQL server 2008 R2 I want to make a simple select that using a GETDATE() show a specific date format without year:    day / month This select gives me the values but in separate columns SELECT MONTH(GETDATE()...
asked by 26.10.2016 / 16:23
1
answer

Failed In The Login Android Studio

This is my code, but when it comes to making the Login that is connected to Sql Server, it does not work, While (rs.next ()) fails. It is not read by the program, I must solve it as soon as possible, I leave my code so please help me solve this....
asked by 12.04.2018 / 23:51
3
answers

SQL query to filter by date a Datetime without including the time

I have a query in sql that looks for some XML by date range, but I think that it is not returning results since the where is with the datetime and I only send the date .. Any suggestions? SELECT A.e_rfc,a.fecha as fecha,C.SupplierName ,A.folio...
asked by 27.08.2018 / 17:37
4
answers

How can I get the latest registration by date and time

I would like to obtain the last value registered in a table, there are two columns in my table DATE and TIME. How can I consult the database so that I can return, for example, the data '8' of the value column?    Structure of my table id_l...
asked by 26.09.2018 / 02:13