georgesOne
Technical User
Good afternoon,
I have two related tables
Table Tools
ID Tool Keytool
1 A True
2 B True
3 C True
4 D False
5 E False
6 F True
Table Failure
FailID ToolID FailureDate Cost
1 1 3/21/2006 $5
2 1 3/27/2006 $3
3 1 5/13/2006 $3
4 2 3/22/2006 $5
5 2 6/20/2006 $3
6 3 6/12/2006 $1
7 5 3/24/2006 $5
For a graph, I want the sum of all StartDate (in March) 3/xx/xxxx records where Keytool= True (i.e. FailID #1 and #2 are matches), all records for keytools without existing Startdate (i.e. ToolID #6) as 0, and also records for keytools with a Startdate other than 3/xx/xxxx as ToolID #3 as 0, but only, if they have no Startdate 3/xx/xxxx, to give following graph data:
xVal yVal
A $8 (sum of two 3/xx/xxxx, the 5/xx/xxxx is excluded)
B $5 (one 3/xx/xxxx, the 6/xx/xxxx is excluded)
C $0 (no 3/xx/xxxx)
F $0 (no StartDate)
D and E are not included because they are no Keytools.
Each Keytool should be included.
How can I do that?
I have two related tables
Table Tools
ID Tool Keytool
1 A True
2 B True
3 C True
4 D False
5 E False
6 F True
Table Failure
FailID ToolID FailureDate Cost
1 1 3/21/2006 $5
2 1 3/27/2006 $3
3 1 5/13/2006 $3
4 2 3/22/2006 $5
5 2 6/20/2006 $3
6 3 6/12/2006 $1
7 5 3/24/2006 $5
For a graph, I want the sum of all StartDate (in March) 3/xx/xxxx records where Keytool= True (i.e. FailID #1 and #2 are matches), all records for keytools without existing Startdate (i.e. ToolID #6) as 0, and also records for keytools with a Startdate other than 3/xx/xxxx as ToolID #3 as 0, but only, if they have no Startdate 3/xx/xxxx, to give following graph data:
xVal yVal
A $8 (sum of two 3/xx/xxxx, the 5/xx/xxxx is excluded)
B $5 (one 3/xx/xxxx, the 6/xx/xxxx is excluded)
C $0 (no 3/xx/xxxx)
F $0 (no StartDate)
D and E are not included because they are no Keytools.
Each Keytool should be included.
How can I do that?