Is there a way in SQL to find the difference for a numeric field between the current record and the previous record? For example, a table has a field called InvoiceNbr. The currect record has InvoiceNbr = 1500. The previous record has the same InvoiceNbr field = 1000 so the difference would be 500. I would like to run a query that shows the previous InvoiceNbr, current InvoiceNbr, and the differnce between the two if the difference between the two records is greater than one. Thanks.
Red Flag Submitted
Thank you for helping keep Tek-Tips Forums free from inappropriate posts. The Tek-Tips staff will check this out and take appropriate action.
Reply To This Thread
Posting in the Tek-Tips forums is a member-only feature.