I'm still new to SQL so this question I am asking may be easy for you. So I am creating a report that for every week generates the prior 14 days (Or 2 weeks) of the funded contracts. I know this has to be Hardcoded to a specific company. The ID for that specific company is '55' So can someone help me with this function? My query I know is not yet finished I am just stuck on how to enter the Date function for this.
Create PROC [dbo].[spAdminFundedDateee]
Begin
SELECT c.program_id, d.dealer_code,b.last_name As DealerName, a.account_no, a.vin,
((e.last_name)+','+(e.first_name)) As Name, a.funded_date, a.cancel_refund_date,
a.purchase_date,a.miles, a.duration,a.sale_price,a.number_of_payments,
a.sales_tax, a.downpayment
from tDealer d
Join tContact b ON d.contact_id = b.contact_id
Join tContract a On d.dealer_id = a.dealer_id
Join tCompany c ON d.company_id= c.company_id
Join tContact E On e.contact_id = a.contact_id
Where c.program_id = 55 And a.funded_date between
End
exec spAdminFundedDateee '05/1/2014','05/30/2014','55'