View Single Post
Old 05-25-2006, 02:12 PM   #1 (permalink)
intecel
Psycho
 
[SQL] - Return last record with 30 days missing.

I am not sure this is possible to do without code, but I figured I'd throw it up here for yall..

Say I have this table:

SaleDate SaleAmt
01/01/2003 5
01/15/2003 10
02/26/2003 5
02/27/2003 7

In this query, I want to return 02/26/2003 because there have been more than 30 days since the last sale. I also only want the result to show the last time there were 30 days... previous ones do not matter.

Is this possible?
intecel is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73