I’m trying to figure out how to query the last person (name) who last (date) worked on a project (project). Content TableA (id) | project | name | date ———-+———-+—————…
Tag: sql
How to get how many hour 4AM have there been between two dates in TSQL
I need to get how many of a specific hour have occurred between two dates in TSQL. Some examples: The following would give the result = 1 declare @date1 datetime = ‘2019-10-01 00:00:00.000’; declare …
Understanding window functions to deduplicate records while retaining true changes
I asked this in dba stack exchange but haven’t had any luck. Cross-posting. SQLFIDDLE I am close to figuring this out but I’m just stuck at a wall. I’m attempting to understand a post by Aaron …
VB.Net Function Return MySql Results Two Dimensional Array
The following code pulls data from a MySql connection and returns the array (output). This two dimensional array only works when the number of rows and columns are specified before running the query. …
How to add characters in the results up to certain length in SQL
I need to add * symbols to make all records to 15 digits. What is the best way? Thanks, Answer Your other questions are tagged for SQL Server, so I will assume that database. SQL Server does not support rpad(), but you can use left() and replicate(): or: If col is not already a string, then you need to cast
How to move decimal places in SQL
I want to place a decimal between the first and second digit of the interest rate and keep 2 trailing after the decimal. How do I go about doing this? SELECT TOP 10 l.PARENTACCOUNT AS [Account Number]…
Display lookup/relational data in a v-data-table with Vue and SQLServer
I created a Node App with Vue.js, Vuetify (Client side of app) and Express (Server side of App) and the data is stored in a SQL Server database (relational database). Everything is up and running on …
How to transpose NULL value to 00:00
I have a view that gets data from an internet database. The view I created works, but when there is no data (NULL) I need it to return 00:00. How can I achieve this? Using SSMS I am getting the starttime of booked resources. I already get them in the right way. But sometimes it returns NULL. I searched the
SQL group two value in a same row
I have this query SELECT to_char(timestamp_arr,’Dy DD/MM/YYYY’) as timestamp_date ,to_char(timestamp_arr,’DD/MM/YYYY’) as link_date ,count(transport_uid) as value ,…
Insert into sql server table, using subquery returning more than 1 value
I have the following tables table1 table2 table3 I want for every id in table2 where condition is true, to insert 2 rows in table1. The rows should have the table2.id and table3.id ( for all ids in table3) Here is my script so far. The expected result should be something like this: table1 id | w_id | w_check_…