开发者

Database designing help for billing system

I am developing a Electronic Bill Payment System for a bank which has more than 100 customers subscribing for Electronic Bill Payment.

I have a table in which I am creating profile for customer like the following.

Customer Table

Cus开发者_StackOverflow社区tomer_ID (Primary key) Customer_Name Address Phone

Bill_Master

  1. Customer_ID
  2. Enrollment_Date
  3. UtilityCompany_ID
  4. Bill_Generation_Date (lets say 18th of every month)
  5. Bill_Due_Date (lets say 27th of every month)
  6. Our_CutOff_Date (when the bank will generate the bill for payment)

I have created the customer along with clue that which utility company's bill generates on which date and what will be the due date of EVERY MONTH.

I want to create an interface where the user will see the entries of all the customers whoz date is due for bill generation and after that user will click on the particular entry and generate the bill manually by entering the amount and other details so for this I am clueless how to find out which customer's utility company bill is due for generation..

Any help how should I design it and query of it? or would be a automatic procedure like job or something which will do it.

thanks


Well if its a query you need to generate bills that are due 27th of every month and also find the customer's utility company, then you can try this -

SELECT A.Customer_Name, B.UtilityCompany_ID FROM
Customer A inner join Bill_Master B on A.Customer_ID = B.Customer_ID
WHERE Bill_Due_Date BETWEEN GETDATE() AND DATEADD(MONTH,-1,GETDATE())
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜