I am developing a recruitment web site. I have 2 tables.
Customers purchase Job Slots which last 12 months. A slot holds one job at a time. The table called PAYMENT holds information about the purchases of job slots made by customers. The table called JOBS shows the jobs posted by the customer to my site and includes a field called "slot used" which referrs to the job slot that the job has been posted into
Table: PAYMENT
Slot Ref username slots Date purchased Date expire
56 ABC Co 10 01 Dec 2003 31 Nov 2004
57 XYZ Co 5 16 Apr 2003 15 Apr 2004
58 ABC Co 2 04 Jun 2003 03 Jun 2004
Table: JOBS
username job name slot used
ABC Co Manager 56
ABC Co Storeman 56
XYZ Co Engineer 57
ABC Co Secretary 56
ABC Co Driver 58
How do I structure a SELECT query to show how many slots a customer (ie ABC Co) has purchased, used and left available to it with the appropriate expiry dates.
In the above example ABC Co has posted 4 Jobs to the web site. It has purchased 12 job Slots into which to post these jobs. It can therefore post a further 8 jobs. I want to be able to show ABC Co the following information
Slots Jobs posted to Slots Slot Expiry
purchased to this slot Available Date
10 3 7 31 Nov 2004
2 1 1 3 Jun 2004
Thanks for your help
Tony
Customers purchase Job Slots which last 12 months. A slot holds one job at a time. The table called PAYMENT holds information about the purchases of job slots made by customers. The table called JOBS shows the jobs posted by the customer to my site and includes a field called "slot used" which referrs to the job slot that the job has been posted into
Table: PAYMENT
Slot Ref username slots Date purchased Date expire
56 ABC Co 10 01 Dec 2003 31 Nov 2004
57 XYZ Co 5 16 Apr 2003 15 Apr 2004
58 ABC Co 2 04 Jun 2003 03 Jun 2004
Table: JOBS
username job name slot used
ABC Co Manager 56
ABC Co Storeman 56
XYZ Co Engineer 57
ABC Co Secretary 56
ABC Co Driver 58
How do I structure a SELECT query to show how many slots a customer (ie ABC Co) has purchased, used and left available to it with the appropriate expiry dates.
In the above example ABC Co has posted 4 Jobs to the web site. It has purchased 12 job Slots into which to post these jobs. It can therefore post a further 8 jobs. I want to be able to show ABC Co the following information
Slots Jobs posted to Slots Slot Expiry
purchased to this slot Available Date
10 3 7 31 Nov 2004
2 1 1 3 Jun 2004
Thanks for your help
Tony