Posts by user90864 • 485 points
20 posts
-
4
votes3
answers485
viewsQ: Aid in SELECT DISTINCT
I have the following select: SELECT CD_CLIENTE, DT_ATUALIZACAO, FROM TABELA Return me the following result: But I’d like to select just the last DT_ATUALIZAÇÃO of each customer, I thought to use a…
-
0
votes2
answers70
viewsQ: Doubt in an SQL DISTINCT
I have the following select: SELECT DISTINCT CD_CLIENTE, CD_CONTRATO, CD_AGRUPADOR FROM TBP_IMPORTAR_OS_RESIDUO WHERE CD_USUARIO = 0 But I wish when the field CD_AGRUPADOR were the same, bring only…
-
-1
votes1
answer80
viewsQ: Keep Fork Updated in git Hub
I joined the Github site and did the Fork of a project, but the original Project got changes, as I do by the site to update the project I cloned? I would like to know if there is any option for the…
-
4
votes1
answer618
viewsQ: Picking Gaps in an SQL sequence
Hello, today I own a select that returns me the following result: I do another select that returns a value, 5 for example. I would need to know which numbers are not between number 1 and number 5.…
-
0
votes2
answers1789
viewsQ: Division in the sqlserver
I am using SQL Server 2008, I would like to split 50/100 for example and return me 0.05. However it returns me 0, follows what I tried to do:…
-
2
votes4
answers3746
viewsQ: Insert html file via javascript
Look I would like to load the "head" part of my html into just one file and then called into html via java script. Today I have following: Header File where you would like to insert the header I…
-
0
votes1
answer38
viewsQ: Doubt Case Sqlserver
I’m using the following case: CASE WHEN RESPOSTA.CD_RESPOSTA = 1 THEN 'ATENDE' WHEN RESPOSTA.CD_RESPOSTA = 2 THEN 'NÃO ATENDE' ELSE 'NÃO APLICÁVEL' END AS DS_RESPOSTA I have the value of…
-
0
votes0
answers84
viewsQ: Error in TASKKILL Command
I would like to close a program when there is error in my system, for this I am using: TASKKILL /F /IM executavel.exe /T I used to develop a machine with W7 and it worked, but the client uses W10…
-
0
votes1
answer958
viewsQ: Sum with Negative and Positive Numbers - Sql Server
I am trying to sum up positive and negative values in the Sqlserver database, but the same done by the calculator returns a different value. I’m using SUM(NR_QUANTIDADE) The NR_QUANTIDADE column is…
-
0
votes1
answer66
viewsQ: Select ROW_NUMBER from an excel table
Today I wear SELECT * FROM [Plan1$] To select the Excel spreadsheet data, I would like to know how to select the record row as well.
-
1
votes2
answers35301
viewsQ: IF WITHIN A SELECT
SELECT @VL_RET_INSS = SUM(VL_RET_INSS), @VL_RET_IRRF = SUM(VL_RET_IRRF), FROM TABELA WHERE VALOR_TABELA > 0 I would like that when the value VL_RET_IRRF was less than 10 the field @VL_RET_IRRF…
-
3
votes3
answers1235
viewsQ: Replace value null
I wish that when you came null in my select replaced by 1900, follows select: SELECT (SELECT TOP 1 tabela1.data FROM tabela1 tabela1 WHERE tabela1.id = tabela2.id) as data FROM tabela2 tabela2…
-
1
votes1
answer53
viewsQ: Maintain a C# - Rest request
The doubt I have is more conceptual than in code. I have a Rest that is a server service, the same is done in C#, I would like every day at a specific time it would request a URL X. I thought of…
-
1
votes2
answers67
viewsQ: Convert Data Sqlserver
I would like to convert02/01/2018 for 2018-01-02 00:00:00.000, what I found on the internet so far was: select CONVERT (datetime, '02/01/2018', 120) Who returns to me2018-02-01 00:00:00.000, a…
-
0
votes0
answers57
viewsQ: Invalid report file path - Crystal - C#
I am trying to generate a pdf from the Crystal report. When I run the code on my machine works perfectly, already when I go up to the server returns me the following error: invalid report file path…
-
4
votes2
answers7073
viewsQ: Put If to Where
I got the following Where WHERE 1 = 1 AND (0 = 0 OR 1 = 1) inicio do if AND (2 = 2 OR 3 = 3) fim do if How would I do if? The idea is that a value per parameter comes and if that value satisfies the…
-
4
votes2
answers2352
viewsQ: Reset datetime time with SQL
Today, man SELECT returns the following date: 2017-11-16 10:37:16.000 I’d like you to return 2017-11-16 00:00:00.000, can help me with this formatting?…
-
1
votes0
answers29
viewsQ: Add Number to Right
Today my select returns me a letter, A, B, C for example. I would like to add two zeros to the right of the letter, how can I do this? Return example: "To" How I’d like it to stay "00A"…
-
1
votes1
answer522
viewsQ: The index and length shall refer to a location within the sequence
I need to break a variable to get the value of the database. Today my full return would be "2017-09-15T14:01:46" I need only 2017-09-15 and 14:01, tried to do .Substring(0,10) for the date and…
-
4
votes2
answers1906
viewsQ: Calculate Difference between 2 dates (has time in them)
Hello, I would like to make the following calculation. Starting Date = 11 September 2017 at 11:35 am Final Date = 11 September 2017 at 12:35 pm It should appear to me 1:10 am. Another example:…