I have a table in my azure sql server named dbo.SQL_Transactional, and there are columns with headers as code, saledate, branchcode code is my primary key, so if there is ever 2 or more rows with the …
Tag: tsql
How to convert “3 Days 18 Hours 39 Minutes” into seconds in SQL Server?
How to convert “3 Days 18 Hours 39 Minutes” into seconds in SQL Server?
Select carried over reports
How do I get the carried over reports + the very first report from the following table? Result should be : 304, 306, 309, and 312. CREATE TABLE [dbo].[test]( [reportID] [int] NOT NULL, [caseID] [int]…
Concatenate rows into one string, what are the different ways and what are they called?
Below are two queries, I’m trying to workout the following questions while on my sql learning quest. Query 1 – What would this be called in sql? I have tried to Web search for usage examples but do …
Round Up Decimal Values in SSRS Report
I cannot get to round up or fix the value of my outcome to Two or one decimal places in Report Builder. I am using Code in my Report Builder Expression: =SUM(Fields!COMPLETE.Value)/SUM(Fields!Total….
SQL : calculate multiple rows to result
How to get result table by calculate multirow? Name Type Value —————————— Name1 Plus 5000 Name1 Minus 1000 Name2 Plus 3000 Name2 Minus 2000 …
Modify SQL to include cumulative sum of all enrollments
I am able to get members cancelled in a quarter with the below query – SELECT DATEPART(YEAR, Canceldate) [Year], DATEPART(QUARTER, Canceldate) [Quarter], COUNT(1) [id Count] FROM Subscription where …
Parse a varchar column containing XML like data into row wise
i have a column in table which contain data like XML,i would like to get data in rows. My table data as- select printDataColumn from Mytable It returns value-
Filter and keep most recent duplicate
Please help me with this one, I’m stuck and cant figure out how to write my Query. I’m working with SQL Server 2014. Table A (approx 65k ROWS) CEID = primary key CEID State Checksum 1 …
Combine 2 tables without primary key
I have 2 tables and wanna combine as below Table Student: Student ID | Student Name ———–+————- 100 John 101 Micheal Table Subject: Subject Name | Subject Desc –…