Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Self join and date difference

Status
Not open for further replies.

Shal2

Programmer
Dec 3, 2001
52
NZ
This is related to the query that I had posted earlier.

The table is like:
--------------------------------------
TYPE DOCUMENTNUM TRANDATE
----------------------------------------
TFO 06305 2004-03-01

TFI 07231 2004-02-12
TFO 07231 2004-02-10

TFI 07348 2004-02-22
TFO 07348 2004-02-20
------------------------------------

Now I want to select just the first row because it doesn't have the TFI row for the same DOCUMENTNUM and also differece between the TRANDATE for that and today's date(Getdate()) is more than 3.Don't want to display it if the date difference is less than 3.

Thank you,
Shal
 
Please, do'nt open new thread to ask the same question.
Furthermore you have already get an answer for the datedifference larger than 3!
If you have no answer, you can ask for more at the end of the thread and it will jump at the top of the threads!!
I'll put my answer at the end of the previous thread

django
bug exterminator
tips'n tricks addict
 
I am very sorry,
won't happen again
Shal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top