R
rahmad
I want to manipulate
the data of my excel pivot table and it's chart which
connected to my db.
And I use a make table query just for trying to keep my original
data,if this manipulation worked well.
Here is my query's SQL statement:
============================================================================
SELECT [Model specification_tbl].Model, [Model specification_tbl].[Remark
rotation speed spec_1], [Model specification_tbl].[Rotation speed lo
limit_1], [Model specification_tbl].[Rotation speed hi limit_1], [Inspection
result_tbl].[Input date], [Inspection result_tbl].[Inspection date],
[Inspection result_tbl].[Lot no], [Inspection result_tbl].RPM_1, [Inspection
result_tbl].Inspector, Format([Inspection date],"mmm-yyyy") AS [Month] INTO
[X - R Chart Data_tbl]
FROM [Model specification_tbl] RIGHT JOIN [Inspection result_tbl] ON [Model
specification_tbl].Model = [Inspection result_tbl].Model
GROUP BY [Model specification_tbl].Model, [Model specification_tbl].[Remark
rotation speed spec_1], [Model specification_tbl].[Rotation speed lo
limit_1], [Model specification_tbl].[Rotation speed hi limit_1], [Inspection
result_tbl].[Input date], [Inspection result_tbl].[Inspection date],
[Inspection result_tbl].[Lot no], [Inspection result_tbl].RPM_1, [Inspection
result_tbl].Inspector, Format([Inspection date],"mmm-yyyy")
HAVING ((([Model specification_tbl].Model)=[Forms]![X - R Chart
Data]![list_Model]))
ORDER BY [Model specification_tbl].Model, [Inspection result_tbl].[Input
date], [Inspection result_tbl].[Inspection date], [Inspection
result_tbl].[Lot no], Format([Inspection date],"mmm-yyyy");
============================================================================
My query is build from two table : "Model specification_tbl" ( Model ==>
PK )
"Inspection result_tbl ( Input date ==> PK )
And the filter I said in my previous post is a criteria for Model.
I want Access to check the no of record in 'Inspection date' .
If actually,this query will return records that note fold 5 ( example : 12
records )
And in an 'Inspection date' there are no of records that < 5 ( 2 records )
then
it need to be populated in the table created by this query.
( That was I mean folded 5 )
'Model' PK might be duplicated or Null ,but 'Input date' PK must be
populated cause next time purposed for grouping the data.And another fields
may
contain Null or default value.
the data of my excel pivot table and it's chart which
connected to my db.
And I use a make table query just for trying to keep my original
data,if this manipulation worked well.
Here is my query's SQL statement:
============================================================================
SELECT [Model specification_tbl].Model, [Model specification_tbl].[Remark
rotation speed spec_1], [Model specification_tbl].[Rotation speed lo
limit_1], [Model specification_tbl].[Rotation speed hi limit_1], [Inspection
result_tbl].[Input date], [Inspection result_tbl].[Inspection date],
[Inspection result_tbl].[Lot no], [Inspection result_tbl].RPM_1, [Inspection
result_tbl].Inspector, Format([Inspection date],"mmm-yyyy") AS [Month] INTO
[X - R Chart Data_tbl]
FROM [Model specification_tbl] RIGHT JOIN [Inspection result_tbl] ON [Model
specification_tbl].Model = [Inspection result_tbl].Model
GROUP BY [Model specification_tbl].Model, [Model specification_tbl].[Remark
rotation speed spec_1], [Model specification_tbl].[Rotation speed lo
limit_1], [Model specification_tbl].[Rotation speed hi limit_1], [Inspection
result_tbl].[Input date], [Inspection result_tbl].[Inspection date],
[Inspection result_tbl].[Lot no], [Inspection result_tbl].RPM_1, [Inspection
result_tbl].Inspector, Format([Inspection date],"mmm-yyyy")
HAVING ((([Model specification_tbl].Model)=[Forms]![X - R Chart
Data]![list_Model]))
ORDER BY [Model specification_tbl].Model, [Inspection result_tbl].[Input
date], [Inspection result_tbl].[Inspection date], [Inspection
result_tbl].[Lot no], Format([Inspection date],"mmm-yyyy");
============================================================================
My query is build from two table : "Model specification_tbl" ( Model ==>
PK )
"Inspection result_tbl ( Input date ==> PK )
And the filter I said in my previous post is a criteria for Model.
I want Access to check the no of record in 'Inspection date' .
If actually,this query will return records that note fold 5 ( example : 12
records )
And in an 'Inspection date' there are no of records that < 5 ( 2 records )
then
it need to be populated in the table created by this query.
( That was I mean folded 5 )
'Model' PK might be duplicated or Null ,but 'Input date' PK must be
populated cause next time purposed for grouping the data.And another fields
may
contain Null or default value.