Posts by Rodrigo Rocha • 191 points
10 posts
-
1
votes2
answers66
viewsA: JOIN with LIMIT in Query
Use this query. It takes the first guest by ID, ie the smallest ID. For each reservation, it takes the smallest. SELECT * FROM Reserva r JOIN Hospedes h ON r.id = h.reserva AND h.id = (SELECT…
postgresqlanswered Rodrigo Rocha 191 -
-1
votes1
answer237
viewsA: Substring after character C#
To do this, just take the position the/string character is in, and then use the substring starting from that+1 position. Follow example. string nr = "ABC: 1"; int posicaoCaractere = nr.IndexOf(":…
-
0
votes3
answers1978
viewsA: Merge 2 Oracle SELECTS and as a result 2 columns with different values
Assuming you want to calculate the 2018 total and 2019 total, follow the code using a 2018 and 2017 consultation. SELECT (select SUM(valor) from web.demonstrativo_processados where nroempresa = 1…
-
0
votes2
answers66
viewsA: Problems creating a foreign key
Add the code to create the Foreign key. Remember the order: First the CREATE TABLE of the category table, and then calls. CREATE TABLE `atendimentos` ( `id` int(11) NOT NULL AUTO_INCREMENT,…
mysqlanswered Rodrigo Rocha 191 -
0
votes2
answers2022
viewsA: Add paragraph in vba
You must use the line break character, which can use the function Chr(10). For this, I created an example that works, taking the values of cells. Private Sub CommandButton1_Click() MsgBox…
-
1
votes1
answer56
viewsA: Listview of Android slow
Your code is not reusing View and is always inflating. The method runs multiple times and always inflates. You can take advantage of convertView. In this case, do it: @Override public View…
-
2
votes1
answer120
viewsA: How to include weekends in the "=Diatrabalho" function and include additional holidays in Excel?
You can use the function: =DIATRABALHO.INTL(data inicial; dias;[fimdesemana], [feriados]) On weekends, you can inform what you consider this weekend. Whether it is Saturday or Sunday (1) or other…
excelanswered Rodrigo Rocha 191 -
1
votes1
answer651
viewsA: Convert Datetime to Date
To do this, just do the following: take only the date of the Datetime object. Example: DateTime apenasData = DateTime.Now.Date; it will put the hour as 0. So, to use the Int, you can use: resultado…
-
3
votes2
answers219
viewsA: Relative path to txt in ASP
To get the relative path, you can use this form: string[] lines = {ENAME, FNAME,LNAME }; System.IO.File.WriteAllLines(Server.MapPath("~/WriteLines.csv"), lines); So just concatenate with your code.…
-
4
votes1
answer65
viewsA: Take HTML from page and Send to Controller
ASP.NET ignored your request for security reasons (XSS, Cross-Site Scripting). Before the method in the controller, use the attribute ValidateInput: [ValidateInput(false)] public void…