B
Benjamins via AccessMonster.com
Hi,
I need some help in creating this query.
I have a table "Customer"
CustomerId CustomerName CustomerStartDate CustomerEndDate
====================================================
1 ; ABC ; 01/01/04 ; Null
2 ; DEF ; 01/01/04 ; 01/12/06
The customer had to pay an annual fee. Those end date which is null means
that the customer is working with the company, Those that have end date means
they have stop working with the company from that day on thus they will not
need to pay the annual fee the next year on.
After the query base on this year, the record will show
CustomerId CustomerName CustomerYear
=================================
1 ; ABC ; 2004
1 ; ABC ; 2005
1 ; ABC ; 2006
1 ; ABC ; 2007
1 ; ABC ; 2008
2 ; DEF ; 2004
2 ; DEF ; 2005
2 ; DEF ; 2006
How should i write the sql code?
I need some help in creating this query.
I have a table "Customer"
CustomerId CustomerName CustomerStartDate CustomerEndDate
====================================================
1 ; ABC ; 01/01/04 ; Null
2 ; DEF ; 01/01/04 ; 01/12/06
The customer had to pay an annual fee. Those end date which is null means
that the customer is working with the company, Those that have end date means
they have stop working with the company from that day on thus they will not
need to pay the annual fee the next year on.
After the query base on this year, the record will show
CustomerId CustomerName CustomerYear
=================================
1 ; ABC ; 2004
1 ; ABC ; 2005
1 ; ABC ; 2006
1 ; ABC ; 2007
1 ; ABC ; 2008
2 ; DEF ; 2004
2 ; DEF ; 2005
2 ; DEF ; 2006
How should i write the sql code?