Duration

SQLServerCentral Article

Calculating Duration Using DATETIME Start and End Dates (SQL Spackle)

  • Article

It's an old problem with a solution that's nearly as old. SQL Server MVP Jeff Moden shows us the old trick mixed with a slick trick to format the duration as extended hours, minutes, seconds, and milliseconds.

4.84 (49)

You rated this post out of 5. Change rating

2015-04-03 (first published: )

49,410 reads

Technical Article

Searching Text datatype

  • Topic

I have a very larre (and growing) table which contains a PK and another column of the type text.The text column contains  XML, and I wish to search for the occurance of the various XML tags in the table.Currently I can use LIKE statements to pull out matches.  Will I still be able to do this […]

You rated this post out of 5. Change rating

2004-03-16

Technical Article

RE: execute sp with output parameter

  • Reply

-- Be sure to declare variables output in -- the execute line of the batch... declare @input1 varchar(10) declare @input2 varchar(10) declare @output1 varchar(10) declare @output2 varchar(10) -- execute myProc @input1, @input2, @output1 output, @output2 output -- -- Here's the proc declaration... -- CREATE PROC myProc @input1 varchar(10) , @input2 varchar(10) , @output1 varchar(10) output […]

You rated this post out of 5. Change rating

2003-08-18

Technical Article

RE: invalid column name

  • Reply

You don't want the SUM in the percent part, plus you can't use aliases in the SUM expression...must use the full expression. If you don't want to do this repeatedly, check out computed columns in BOL: Sum([intquantity]*[curcost]) AS Cost, Sum([intquantity]*[curprice]) AS Price, sum(([intquantity]*[curPrice])-([intquantity]*[curcost]))AS Profit, ((sum(([intquantity]*[curPrice])-([intquantity]*[curcost]))/Sum([intquantity]*[curprice]))*10000)/100) AS [ProfitPercent] [/code]

You rated this post out of 5. Change rating

2003-06-05

Blogs

Small Data SF 2024

By

I can’t remember how I heard about Small Data SF 2024, but it caught...

A New Word: Moledro

By

moledro – n. a feeling of resonant connection with an author or artist you’ll...

Snowflake + Azure blob

By

Let’s go back to data platforms today and I want to talk about a...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers