How to find number of days between 2 dates in the same FIELD?

T

The Sunny Doctor

I want to how is it possible to find out days between 2 dates in one field.

Eg.

[Sales Made On] is a date field with following values:

10/10/2004
10/15/2004
10/19/2004

How can I find the days lapsed between 2 consecutives values in the above
given field?

Thanks.
 
D

Duane Hookom

Try:
SELECT *,
[Sales Made On] - (SELECT Max([Sales Made On])
FROM tblA A
WHERE A.[Sales Made On] < tblA.[Sales Made On]) as Difference
FROM tblA;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top