473,881 Members | 1,697 Online

# calculating date differences on dynamic variables

Not sure if my subject is entirely accurate but here goes.

I need to calculate the date difference between a date A and a date
B... however date B relies entily on date A.

EG: i have an advert in a paper (The Daily Telegraph say), now i need
to know the next and previos dates that this occured.

I can do this very easily for a one time calculations, however i need
to do this for many 000's of rows.

Now the real problem is this:

I have a list of say 1000 with a ID of 1, and a list of 800 with ID of
2.

Now i need to find the nearest dates (read next/previous) in table 2
for each entry in table 1.

Is this possible?

and if so any tips/helps much appreciated...

Thanks,

Beech

Jul 3 '06 #1
1 1863
On 3 Jul 2006 09:55:03 -0700, b.********@gmai l.com wrote:

Not entirely sure what you mean. Can you put this in terms of the
Northwind sample application? Also a great tool for us to experiment
with a query.
Perhaps you mean: give me a query that returns:
OrderID, OrderDate, OrderDatePrevio usOrder, OrderDateNextOr der

-Tom.

>Not sure if my subject is entirely accurate but here goes.

I need to calculate the date difference between a date A and a date
B... however date B relies entily on date A.

EG: i have an advert in a paper (The Daily Telegraph say), now i need
to know the next and previos dates that this occured.

I can do this very easily for a one time calculations, however i need
to do this for many 000's of rows.

Now the real problem is this:

I have a list of say 1000 with a ID of 1, and a list of 800 with ID of
2.

Now i need to find the nearest dates (read next/previous) in table 2
for each entry in table 1.

Is this possible?

and if so any tips/helps much appreciated...

Thanks,

Beech
Jul 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.