all groups > sql server reporting services > june 2005 >
You're in the

sql server reporting services

group:

Date Difference


Date Difference Bunckles
6/1/2005 10:54:38 AM
sql server reporting services:
A table has 2 columns (Date and Trans). Date has the date of the
transaction, Trans contains whether the transacion was an invoice or a
payment.

I need to determine how long customers are taking to pay their bills.
How can I find the difference in the invoice date and the payment date
if both dates are part of the same field?
Re: Date Difference Wayne Snyder
6/1/2005 6:00:29 PM
Assuming there is some key value which shows that the 2 rows are connected
( and I am calling the field KEY)..

Select datediff(dd,i.[date],p.[date]) from thetable i inner join thetable p
on i.key = p.key
WHere whatever selection criteria you wish to use...

--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

[quoted text, click to view]

AddThis Social Bookmark Button