Tweeted twitter.com/StackDBAs/status/837534425088835584
4 added 42 characters in body
source | link

This produces a table like thisthis: enter image description here

This produces a table like this

This produces a table like this: enter image description here

3 general tidy
source | link

This information is stored in 2 tables,tables; Targets, and Analysis. (as well as a user table which converts their name, which is stored as initials in these 2 tables, into their full names). These tables have multiple time entries for each month (but months are stored as period, hence the case statement below to convert period to months in a financial year May(May - Apr), and as such, multiple month entries for each year for the solicitors to record their time spent on each case they are working on.

What I'm struggling with is adding the yearly figures to this table, or even to each other. I have written 2 separate queries that work. The 1st one gives the yearly target, and the 2nd gives the progress towards the yearly target. They are as follows ;

My problems is that 1) i can;t even join to 2 yearly queries together, whenever i try i get an error along the lines of "Arithmetic overflow error converting expression to data type int". 2) I need both these sets of data adding tot hat initial function i create.

Sorry thisMy problems is so long and rambly but I'm stumped and it's not easythat 1) I can't even join 2 yearly queries together, whenever I try I get an error along the lines of "Arithmetic overflow error converting expression to explain!data type int". 2) I need both these sets of data adding to that initial function I create.

ThanksSorry this is so long and rambling but I'm stumped and it's not easy to explain!

This information is stored in 2 tables, Targets, and Analysis. (as well as user table which converts their name, which is stored as initials in these 2 tables, into their full names). These tables have multiple time entries for each month (but months are stored as period, hence the case statement below to convert period to months in a financial year May - Apr), and as such, multiple month entries for each year for the solicitors to record their time spent on each case they are working on.

What I'm struggling with is adding the yearly figures to this table, or even to each other. I have written 2 separate queries that work. 1st one gives the yearly target, and the 2nd gives the progress towards the yearly target. They are as follows ;

My problems is that 1) i can;t even join to 2 yearly queries together, whenever i try i get an error along the lines of "Arithmetic overflow error converting expression to data type int". 2) I need both these sets of data adding tot hat initial function i create.

Sorry this is so long and rambly but I'm stumped and it's not easy to explain!

Thanks!

This information is stored in 2 tables; Targets and Analysis. (as well as a user table which converts their name, which is stored as initials in these 2 tables, into their full names). These tables have multiple time entries for each month (but months are stored as period, hence the case statement below to convert period to months in a financial year (May - Apr), and as such, multiple month entries for each year for the solicitors to record their time spent on each case they are working on.

What I'm struggling with is adding the yearly figures to this table, or even to each other. I have written 2 separate queries that work. The 1st one gives the yearly target, and the 2nd gives the progress towards the yearly target. They are as follows ;

My problems is that 1) I can't even join 2 yearly queries together, whenever I try I get an error along the lines of "Arithmetic overflow error converting expression to data type int". 2) I need both these sets of data adding to that initial function I create.

Sorry this is so long and rambling but I'm stumped and it's not easy to explain!

2 edited tags
| link
1
source | link