Posts by Renan Bessa • 631 points
67 posts
-
-1
votes1
answer34
viewsQ: Edit PHP Data with Jquery and Modal Bootstrap
Gentlemen, because in the code below is not passing the data (fetch) to the modal so I can update? Html <a href="#editModal" class="edit" data-toggle="modal"><i class="material-icons"…
-
0
votes1
answer471
viewsQ: Sum Column HTML Table
how to perform the automatic sum of a specific column? I tried with the script below using Jquery, but without success. The total value in the column to be filled is in the last . (space is blank).…
-
0
votes0
answers586
viewsQ: Remove SQL Server special characters
how do I remove special characters from a string in a query in SQL Server with tags in html, xml and others? Current result: <!--[if !mso]><styl>v\:* {behavior:url(#default#VML);}o\:*…
-
0
votes1
answer483
viewsQ: Sorting 2 Columns at the same time SQL Server
I have the following table structure. Ticket | Data | ID The data field is datetime, ticket, id and generator are int. What I need is for ticket and date fields to be sorted at the same time.…
-
0
votes1
answer794
viewsQ: SQL Server Row Number Counter
how do I perform a counter on the sql server from a certain number. Example below. Current result Ticket Ação 42977 1 42977 2 Expected result 42977 3 42977 4 42977 5 ---Below the query--- The first…
-
2
votes1
answer260
viewsQ: SQL Server Binary File
how do I download images, content, files that are stored directly in the database in binary form? I ask this, because I am in a data migration and the layout (spreadsheet in excel) of the new system…
-
2
votes1
answer873
viewsQ: Error executing report in SQL Server Reporting Services
The following error is occurring while running a Reporting Services report: "Report processing error. (rsProcessingAborted) Not possible to create a connection to the data source 'Production'.…
-
3
votes1
answer49
viewsQ: Doubt - Query SQL Server condition
Guys, in the query below is bringing in the following way. However, I want you to bring only the 'YES'. The difficulty is because it is a subselect with case. I bring where? No Where or a having?…
-
1
votes1
answer78
viewsQ: Query Doubt in SQL Server 2012
I need that in this query come only records where the ABC CURVE column is different from the MODEL column. For example, this customer the ABC curve of it is silver and the model is diamond/gold, so…
-
1
votes1
answer100
viewsQ: Doubt - Case when inside a Stuff - SQL Server 2012
Guys, how do I put a case when exists within the query below. The result is currently coming out like this: Customers Drugstore, Soccer, Gelagua However, I want to put a case when exists if it is in…
-
0
votes1
answer68
viewsQ: Error while running script
Guys, I’m trying to run the query below, however, the following error occurs. "Conversion of a data type varchar into a data type datetime resulted in a value outside the range.". select…
-
0
votes1
answer2207
viewsQ: Error convert Query SQL Server date and time
Guys, I’m trying to run the query below, however, the following error is occurring. " Failed to convert string date and/or time.". I have done some other conversions, but without success. select…
-
0
votes1
answer767
viewsQ: Error running SUM - SQL Server
Guys, I’m trying to perform the SUM according to the query below, however, the following error occurs. " It is not possible to perform an aggregation function on an expression that contains an…
-
0
votes0
answers40
viewsQ: Query - SQL Server with Stuff
Guys, in the query below I want you to bring it in the following way. contato andreia, marcos, juliana that is, on the same line. In the consultation, I used the stuff, but without success. Today…
-
0
votes1
answer795
viewsQ: Division between values - Query SQL Server 2012
Guys, in the query below, is bringing the following way. Ano Mes Horas total_horas 2018 1 107 766 H 2018 1 225 766 H Therefore, I want you to bring in another column the division of the column…
-
0
votes1
answer38
viewsQ: Sqlquery - Some Duplicate Records
Guys, in the query below is bringing the following way. UsuID Consultor Tentativa 1 Abertos 95093 Gabriela 96 However, it was to bring in the following way: UsuID Consultor Tentativa 2 Abertos 95093…
-
1
votes2
answers56
viewsQ: Query SQL Server - Union
Guys, the following query below through the Union is bringing in as follows. Consultor UsuID Tentativa 1 Abertos Gabriela Sousa 95093 17 Gabriela Sousa 95093 32 But I want to bring it this way:…
-
1
votes1
answer61
viewsQ: Doubt - SQL Server 2012 Query
People, in the query below want to put a condition within the Where that bring only the tasks that are due two months after the opening date. For example. The task 11111 was opened on 01-11-2017 and…
-
1
votes1
answer751
viewsQ: Division error by zero - Query SQL
I have the following query below, however, when I run it, the following message occurs: erro de divisão por zero. I tried to use the function nullif, but without success. How to solve? SELECT…
-
2
votes3
answers58
viewsQ: SQL Query - Doubt Condition Dates
Guys, good afternoon! I’m having difficulty in the consultation below. I want you to bring all the tasks only when their salary (tarexpiration field) is equal to the month after the opening date…
-
0
votes1
answer39
viewsQ: Doubt - Query SQL Server 2012
I have a query below that I need to bring inside the case only when the field Tarvencimento is less than today’s date (so far I managed to do), however, only when today’s date is 5° day after the…
-
4
votes1
answer145
viewsQ: Trigger without replicating data - SQL Server 2012
Guys, I have a Trigger in the FRM_46 table that would replicate the data right after the Insert or update to the FRM_31 table, however, it is not replicating, I already analyzed and made the tests,…
-
2
votes2
answers1233
viewsQ: Date Working Hours - SQL Server
Guys, I have a question. In the query below, in the tarexpiration field, he is counting the hours normally, however, I want to count only the working hours. NOTE: Already has a useful hours function…
-
3
votes1
answer43
viewsQ: Creation of Trigger
I need to develop a Rigger in which any change that occurs in one of these fields below the Task table should send the task information to the Instruction table. TASK TABLE TarefaID Vencimento…
-
3
votes2
answers80
viewsQ: How to create a condition that does not include the month of December?
I am creating a condition to be executed before the month of December, IE, only runs in the period of january to november year-independent. IF (SELECT TarFechamento FROM Tarefa WHERE TarID =…
-
10
votes5
answers972
viewsQ: How to get the name of the day of the week on the first day of the month?
How do I get the name (Monday, Tuesday, Wednesday...) of the first day of the month of December from the current date?
-
0
votes3
answers171
viewsQ: Doubt - Update SQL Server 2012
When the update below is run for the first time, the field comes out correctly in the way I want it to be below, but if I run it again, it comes out that way. What I want is that regardless of how…
-
1
votes1
answer202
viewsQ: Error run UPDATE SQL Server
When executing the update statement below is occurring the following error. What can be? Msg 116, Level 16, State 1, Line 3 Only an expression can be specified in the selection list when the…
-
0
votes0
answers51
viewsQ: Generate sql script on a given date
Good afternoon! Guys, I have a big mission here. I have a script that I assembled below that I need it to be executed only on the 1st of each month respecting the two conditions I put in the IF…
-
2
votes1
answer74
viewsQ: Doubt - Insert SQL Server 2012 table
I need to insert some information in the table called task, however, only when a certain condition is accepted that in the case of these two date fields, I put it for today for example if it was…
-
3
votes1
answer505
viewsQ: Update in two SQL Server tables
How do I perform an update at the same time on two different tables? I have a table called Tarefa and another call VinculoReferencia, both have the field Taridinclusao where is this field that needs…
-
0
votes1
answer235
viewsQ: Update with select CTE Error
I am having difficulties to perform an update with select CTE. I want to update the charging field. Below is the query and just below is the update I tried to perform, but the following error…
-
1
votes1
answer68
viewsQ: SQL Server Doubt 2012 - Query
I am having a hard time. In the consultation below, you are bringing in this way. Tarefa_Inclusao Tarefa 167909 167920 SELECT TarIDInclusao [Tarefa_Inclusao],tarid [Tarefa] FROM Tarefa WHERE TarID =…
-
0
votes1
answer304
viewsQ: Doubt - SQL Server Dates
In the script below when one task is completed the other will open on the first working day of the following month. Example: Task 10 was completed on the day 18-11-2016, then another will be…
-
2
votes1
answer1021
viewsQ: Consultation with MAX(DATE)
I am trying to generate the query below as follows. Cliente Tarefa Data da Ultima Providencia Teste 16555 04-07-2017 However, is generating duplicate, IE, I want to take the last date of the last…
-
0
votes1
answer1178
viewsQ: Working day function
The query below in datediff is bringing the difference of days correctly, but I just want to bring the amount of working days. I already have a business day function that excludes Saturdays, Sundays…
-
3
votes1
answer1018
viewsQ: Error converting from varchar to smalldatetime
In the query below the following error occurred: Conversion of a data type varchar into a data type smalldatetime resulted in a value outside the range. Looking at it, I realized that if I take the…
-
-1
votes2
answers1495
viewsQ: SQL Server Function - Holidays
Good afternoon! Dear friends, I have the following function below that is the days not worked that are coming only Saturday and Sunday, however, I wanted to include in this function the holidays.…
-
2
votes2
answers395
viewsQ: How to extract the date-time of a given XML field in a string - Query SQL Server 2012
Good afternoon! Guys, in my log table there is a field called logdescricao and in this field it stores several expressions. For example: <log expressao="7085"><par traduzir="N">André…
-
0
votes1
answer1383
viewsQ: How to perform only 1 specific table Restore in SQL Server 2012
Good afternoon! Guys, I have a situation: I have a backup of the database and the server has already been created a database with this base called test, however, I need to migrate a specific table…
-
1
votes2
answers337
viewsQ: Add WITH query inside another query - SQL Server
Guys, how to add the query below as a subconsulta. Consultation with WITH: WITH dias AS( SELECT CAST('2017-06-26' AS DATE) AS dia UNION ALL SELECT DATEADD(DAY, 1, d.dia) FROM dias d WHERE d.dia <…
-
2
votes3
answers640
viewsQ: Grouping by day and by date period
I have a query of the period 26 a 30-06 that brings the following result: Data_Cancelado Cancelados 27-06-2017 4 29-06-2017 5 However, I want it to come this way, ie,. Data_Cancelado Cancelados…
-
1
votes2
answers1323
viewsQ: Bring results equal to 0 as blank value in a query in SQL Server
I have a query below that the records that have nothing is coming with 0. I wish it could come blank. Example: select F.C37 [Pontuação], ISNULL(count(distinct TD.UsuIDCliente),'-') [Qtde_Clientes…
-
0
votes2
answers64
viewsQ: Doubt - SQL Server Query
As I do in sql server to get the records larger than 10 days from the current date, that is, in the current month, I want to get all the records prior to day 01-08. I tried that way, but you didn’t…
-
0
votes1
answer201
viewsQ: Slow Query - SQL Server 2012
The query below is taking on average 30 seconds to execute. I know that very likely can be the various or and like, but I am searching from the log table and not always the id will be the same, why…
-
1
votes2
answers1525
viewsQ: Browse previous record - SQL Server 2012
I need to bring only the records where the previous status was 1, but which is currently 0. I have a table called solicitação containing a field called VencimentoPausado, where this field values are…
-
2
votes2
answers94
viewsQ: Adds WITH query within another query
Guys, how to add the query below as a subconsulta. Consultation with WITH: WITH tabela (projeto, operadora) AS ( SELECT p.projdesc, tt.tartitulo FROM tarefa tt INNER JOIN projetos p ON p.projid =…
-
1
votes1
answer69
viewsQ: Doubt query - SQL Server 2012
Good afternoon! Guys, I don’t know if it’s possible, but I wanted to know how to get a record of a line in another line. I’ll illustrate. In the query below is coming out like this. Projeto…
-
3
votes1
answer140
viewsQ: Query - Bring 5 major records
I have the query below, where I need to bring only the 2 largest columns that have the highest values. Today is coming out like this: Conciliacao Extrato Integração 150 140 80 That is, I wanted to…
-
0
votes2
answers51
viewsQ: Image is not centering
Guys, I’ve tried several ways, but the image is not centering. Follow below the code to better understand the problem: .logo2 { color: pink; position: absolute; margin: 0 auto !important; float:…