I have a table called 'Bill' which is a table for a database for a restaurant system. Sample data is below:
Bill_Code, Date, Customer_ID, Order_Code, Total_Amount, Discount, Payable_Amount, Payment_Type, Staff_Name
'B201404012000', '2014-03-21', 'S8909608D', 'O222224', '0.00', '0.00', '0.00', 'CASH', 'Dany Lim'
'B201404012030', '2014-04-01', 'S8409608D', 'O222221', '100.00', '0.00', '100.00', 'VISA', 'Arya Stark'
'B201404012032', '2014-04-01', 'S8609608D', 'O222222', '80.00', '0.10', '72.00', 'VISA', 'Arya Stark'
'B201404012033', '2014-04-21', 'S8709608D', 'O222223', '0.00', '0.00', '0.00', 'NETS', 'Rob Targa'
'B201404012039', '2014-04-01', 'S8709655D', 'O222225', '0.00', '0.00', '0.00', 'MASTERCARD', 'Dany Lim'
'B201404012053', '2014-04-15', 'S8909608D', 'O222224', '0.00', '0.00', '0.00', 'CASH', 'Dany Lim'
'B201404012115', '2014-04-11', 'S8909608D', 'O222226', '50.00', '0.00', '50.00', 'CASH', 'Rob Targa'
I need to find which two dates with the same Customer_ID have a date interval of 30 days.
Meaning, I need to find out if any particular customer has had a lapse of 30 days between visits.
Appreciate your help. Thanks in advance.