Posts by Felipe Michael da Fonseca • 813 points
74 posts
-
0
votes1
answer257
viewsQ: How to take all values of a select and run in a Procedure?
How to take all the values of a select and play in a precedent to give an Insert without running one value at a time? I have the following sql code: --drop table #tabelaEntSaida; --drop table…
-
0
votes3
answers3992
viewsQ: Convert Date to year / month
I was able to convert the date to year / month, but I need the date to go like this: 2019/04, but it’s coming out like this: 2019/4 how can I fix this? SELECT CONVERT(VARCHAR(4), DATEPART…
-
-4
votes4
answers620
viewsQ: How to round off this number: 3084.08 SQL SERVER?
How can I round this number: 3084.08 to: 3084.09 in sql server?
-
6
votes1
answer400
viewsQ: How to return the last value of an sql string?
I need to use the last character of a string G. Like I get it with sql server? SET @VALOR = '0000050529-G' I want to take the letter G
-
-3
votes1
answer43
viewsQ: Return dates between number of days
I wonder how I do: I want a variable like days then take the result of this variable and select between the dates counting the number of days Some solution or example?
-
0
votes1
answer127
viewsQ: While always returns the last record in sql server
I have a select to bring all the records that have been entered and I need to do a while to go through this select and give an Insert in another temporary table. Only that the while is always…
-
0
votes2
answers448
viewsQ: How to return empty value?
By adding up any positive number with the result of a Subquery get as return null and need to return 0 so it is possible to add with the first value obtained. What can I do to make the query return…
sql-serverasked Felipe Michael da Fonseca 813 -
1
votes1
answer720
viewsQ: How to add sql values in column
I have the following sql code: select PS.PatSldBemValResidAnt ,PS.PatSldBemValDepAcum ,Sum(PS.PatSldBemValDep) PatSldBemValDep ,Sum(PS.PatSldBemValResid) PatSldBemValResid from Pat_Saldo_Bem as PS…
-
0
votes2
answers115
viewsQ: Select all customers and check if you are carrier and supplier
I want to make a select that selects all customers and next create two columns a carrier call and another supplier and in each of them mark yes or no. Ex: Código Nome Fornecedor Transportadora 01…
-
2
votes3
answers7703
viewsQ: Remove last number with sql
I would like to take the last paragraph 1 from this sequence: 0495747500000049908275289000100040000000041 How do I do in sql server?
-
2
votes1
answer528
viewsQ: Error: SQL Server String or Binary data would be truncated
I have the variable @numero1 which brings the following result: 020000000000720000018 But at the time of update gives error: SQL Server String or Binary data would be truncated declare @g1…
-
-1
votes1
answer35
viewsQ: How to put zeros after type checker - sql server
I need to put 9 zeros after 02: 0207200000053P 02- here comes the zeroes - 07200000053P that is coming from a variable called @vNossoNumero. How do I do that? Variable Select @vNossoNumero = case…
-
1
votes0
answers68
viewsQ: Column number of supplied values does not Mach table Definition - SQL SERVER
I have the following problem in sql server when I put the CASE clause at the end of this line of code: DECLARE @RESULTADO TABLE ( Total INT, GrupoTitulo VARCHAR(255), GrupoChave VARCHAR(255),…
-
0
votes1
answer566
viewsQ: How to add equal amount SQL?
I have the following query: SELECT DISTINCT CTRL_CARGA_PED_VENDA.CtrlCargaNum, ITEM_PED_VENDA.PedVendaNum, PRODUTO.ProdCodEstr, PRODUTO.ProdNome, Sum(ITEM_PED_VENDA.ItPedVendaQtd) AS QtdItem FROM…
-
1
votes1
answer481
viewsQ: Syntax error in with SQL Server
Tenh the following error in sql server: Incorrect syntax near the keyword 'with'. If this statement is a common table Expression, an xmlnamespaces clause or a change tracking context clause, the…
-
0
votes1
answer71
viewsQ: Take only the values that are different in the query
I made a query that brings the values of credit and debit, but I need to bring only the values that are different from these two fields. At the moment I do not know why it is bringing all. Look at…
-
1
votes2
answers235
viewsQ: Case in Where using SQL Server
I have the following code that lists certain trade agreements. You have the Yes or No option. DECLARE @Opcao VARCHAR(7) SET @Opcao = 'S' SELECT * FROM BLA BLA BLA WHERE ((('{Opcao}' = 'S') AND…
-
2
votes3
answers590
viewsQ: How to remove apostrophes from a variable
I have a text Edit PRODUCT that comes like this: 'STICKER 478', with apostrophes. How do I make it come out like this: STICKER 478 on sql server? I’ve tried that and it doesn’t work: DECLARE…
-
0
votes1
answer61
viewsQ: How to improve this sql code?
I would like to improve this code so that it does not repeat the same code in both Ifs. I don’t feel like using procedures because I don’t see the need. DECLARE @Ordem VARCHAR (7), @Valor…
-
2
votes2
answers428
viewsQ: Cursor problem: SQL Server
I have a problem with the cursor part: cursor with the name 'Cursobanco' does not exist. Sql code: if @Opcao='1' begin set @tipoPagamento='20' set @LayOut='040' declare CursoBanco Cursor LOCAL…
-
-2
votes1
answer70
viewsQ: No repetition of SQL SERVER code
I have the following code in sql server. I need to make sure that in the first if it comes out and runs the same instruction that is inside the Else tag not to repeat the code that is inside. How do…
-
0
votes2
answers67
viewsQ: How to make a Count work by taking only the fields I want?
How can I catch a field I want doing the COUNT work? select PVN.NFNum, COUNT(distinct CtrlCargaNum) as Qtd from CTRL_CARGA cc INNER JOIN PED_VENDA_NOTA_FISCAL PVN ON cc.EmpCod = PVN.EmpCod where…
-
0
votes2
answers49
viewsQ: How do I count the amount of items in a repeated field?
I have a table with the Ctrlcarganum field that has a record of the cargo number of a truck. I need to make a consultation that brings the total of this field. Until I could make the consultation…
-
2
votes1
answer170
viewsQ: PDF in Binary DOMPDF Standard
I have a problem in the Windows when mounting a PDF. It gives the output all in binary. I am https://github.com/barryvdh/laravel-dompdf Look at the code: public function relatorio($id) { $pedidos_id…
-
2
votes1
answer50
viewsQ: Each always returns the last term of a JQUERY table
I have the following code running through a table that contains data, but I don’t know why it always returns the last item when I select an object. It does not return the other items. Code:…
-
0
votes1
answer474
viewsQ: Add multiple products in one sessionStorage
I add the product through a select, but when I try to add another it erases what is in the sessionStorage current. How do I add the two? I have the select in html that brings the product, and when…
-
0
votes1
answer387
viewsQ: How to make more than one select in the field for Jaspersoft
I need to create two selects. One for the total and one for bringing all fields. How do I put 2 selects in the field creation query? I need him to add this total:…
-
1
votes2
answers76
viewsQ: Problem in consultation with Join
I’m having a little problem with the consultation to generate a report. I made a JOIN of the orders table (that will take the report) with the table of customers and products. Until then everything…
-
1
votes2
answers179
viewsQ: How to calculate the total value in a dynamically created table?
I have the following code that creates a table in jquery. The problem is that I wanted to create a subtotal that would add up all the values of the total column. But I’m not getting it because the…
-
0
votes0
answers78
viewsQ: Return if in jquery
How can I Return this if to pass the value of the page in ajax? The function brings the null value by default. Then I take the if and see and is null it is equal to 1 and if it is greater than the…
-
0
votes0
answers219
viewsQ: Create automatic pagination with Laravel and jquery
I need to create a manual pagination in the Standard. I don’t really understand the logic of this topic: Manual Paging in Laravel 5.1 But I need to make him create the automatic pages. Not manual.…
-
1
votes1
answer522
viewsQ: Does anyone have any idea how to create a pagination with RESTFULL API in Laravel?
Could someone give me an example of how to do this and JQUERY build paging? Even if it’s some tutorial. I have already searched several places and all say the same thing to create a pagination in…
-
3
votes1
answer466
viewsQ: Creating routes for paging
I created a Restfull api in Laravel. In the project I have javascript and html in a folder that calls the API. Soon I created a pagination in the proper Laravel that I called in my own project in…
-
0
votes1
answer44
viewsQ: Select Checkbox value
How can I select the value of the checkbox below? I need when I click the checkbox to get the value of the checkbox clicked. https://jsfiddle.net/ckzq8yef/…
-
0
votes1
answer970
viewsQ: How to solve this problem in Datatables?
I have a problem with Datatables that is keeping me awake. I have the following code. It even shows the datatable but the table functions don’t work. Next doesn’t even show the Prev. If I remove the…
-
0
votes1
answer1386
viewsQ: Error: Datatables Warning: table id=datatable-checkbox - Cannot reinitialise Datatable - JQUERY
I have the following problem in building a datatable: Datatables Warning: table id=datatable-checkbox - Cannot reinitialise Datatable. For more information about this error, Please see…
-
0
votes1
answer572
viewsQ: Create id field with Datatable Jquery Checkbox
I have the following datatable: function retorna_cliente() { $(".mostra_clientes .table").dataTable({ "bDestroy": true }).fnDestroy(); $('.mostra_clientes .table').DataTable({ "pageLength": 4,…
-
1
votes1
answer217
viewsQ: How to organize pages with a table in Jquery
I have the following each that returns all customer records within a table, and that works perfectly: $.each(data, function(key,item) { id_cliente = item.id; nome_cliente = item.nome;…
-
0
votes2
answers112
viewsQ: Paging with twbsPagination plugin giving problem
Well I made a pagination with the twbsPagination plugin, it works perfectly, but it does not list the amount of elements per page. What did I do wrong? I wanted you to list 4 elements per page. Look…
-
-1
votes1
answer1083
viewsQ: How to make a pagination with jquery and ajax?
I have a function that returns all customer registrations. But my question is how can I make a pagination with this code? THE ELEMENTS ARE CREATED DYNAMICALLY. HOW CAN I RESOLVE THIS? function…
-
0
votes1
answer96
viewsQ: Why does DELETE give error?
I have the following function in jquery which gives the delete in the record. It even deletes the record but does not go to the success, he goes to the error. Why will it be? function…
-
3
votes1
answer75
viewsA: Problem in SQL query in the Laravel
RESOLVED: I managed to solve with the following function: public function getMunicipios($estados_id) { $municipios = DB::table('municipios') ->where('estados_id','=', $estados_id)…
-
2
votes1
answer75
viewsQ: Problem in SQL query in the Laravel
I’m not really understanding these queries in php Standard. I searched cities states where when searching the state lists the corresponding city, but it does not find the table id if the…
-
4
votes1
answer1227
viewsQ: How to filter by state cities in Laravel?
I made a filter in the Laravel and it works perfectly but nevertheless brings all the cities. It does not bring the specific cities of that state. I do not know if it is this filter that has to pass…
-
0
votes1
answer109
viewsQ: What is the relationship problem in these tables?
I’m using the Laravel and would like to make a relationship of table of municipios containing the estado_id. The estado_id will be related to the estado_id of table of estados. Just when executing…
-
-2
votes1
answer9264
viewsQ: How to refresh the page?
I needed when the person clicked on a button on the previous page to move to the next page and refresh it. How do I do this? I need this refresh because otherwise I’ll have to do a "gambiarra" to…
-
1
votes2
answers1086
viewsQ: Compare two values with jquery
Like I do to compare two variables. I have a variable that brings the neighborhood id, called bairrocadastrado, it returns the neighborhood ID equal 1093. Soon I have a foreach that returns all the…
-
0
votes1
answer269
viewsQ: How to check equal values of a Foreach
Well I have two forEach. The first takes the value of a sessionStorage, that is, the ID of the neighborhood registered by the user. The second returns all registered neighborhoods and their…
-
1
votes0
answers297
viewsQ: Renew Authentication Token with javascript
I have the JWT class but I can’t renew it. How do I renew this token when the registration is done? I already own the token in sessionStorage called token with key. Class: function parseJwt (token)…
-
0
votes1
answer852
viewsQ: To return the function variable in Jquery
Hello I would like to return the state variable to inside another function. How do I do this? The returned variable in returnEndereco is Undefined. function retornaEndereco() {…