Assuming you're using PHP, loop through the results and call strtotime on the SaleDate values, then put the results into an array. Then, using the unix timestamps, loop backwards through the loop looking for a delta >= 30 days (in seconds). When you find a pair of values which match this condition, you can break out of the loop and use whatever your incrementer value was to perform whatever operations you're wanting to do.
Last edited by insidious_machinae; 05-25-2006 at 10:28 PM..
|