Hi Guys
i have the table below
employee | start date | sale date | Sales Amount |
---|---|---|---|
Ian | Jan-20 | Jan-20 | 2 |
Ian | Jan-20 | Feb-20 | 5 |
Ian | Jan-20 | Mar-20 | 6 |
Ian | Jan-20 | Apr-20 | 10 |
Ian | Jan-20 | May-20 | 12 |
John | Feb-20 | Feb-20 | 7 |
John | Feb-20 | Mar-20 | 1 |
John | Feb-20 | Apr-20 | 5 |
John | Feb-20 | May-20 | 0 |
John | Feb-20 | Jun-20 | 11 |
I want to a create a query to add another column to show which month potion is the sales month from the employee start date ( e.g 1st month second month etc)
so the outcome i want is below
employee | start date | sale date | Sales Amount | month number |
---|---|---|---|---|
Ian | Jan-20 | Jan-20 | 2 | 1 |
Ian | Jan-20 | Feb-20 | 5 | 2 |
Ian | Jan-20 | Mar-20 | 6 | 3 |
Ian | Jan-20 | Apr-20 | 10 | 4 |
Ian | Jan-20 | May-20 | 12 | 5 |
John | Feb-20 | Feb-20 | 7 | 1 |
John | Feb-20 | Mar-20 | 1 | 2 |
John | Feb-20 | Apr-20 | 5 | 3 |
John | Feb-20 | May-20 | 0 | 4 |
John | Feb-20 | Jun-20 | 11 | 5 |
i am struggling to do this, can this be done? i
thank you for any help