Repost : Mission to populate record through a make table query

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.
 
R

rahmad

rahmad said:
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.
 
R

rahmad

OK I able to retrieve the data I want through a select query
by modify the clause where like below :

WHERE ((([X - R Chart Data_tbl].[Lot no]) In (SELECT [Lot no]
FROM [X - R Chart Data_tbl] As Tmp GROUP BY [Lot no]
HAVING Count(*)<5 )))

But then how to populate the record.Let say I want to copy the value
of some fields in the last record then paste/duplicate them untill they
become
5 records.And this routine work repeatly untill there are no records in this
query.

For example:
This time there are 2 records in this query,then I want that code to copy
the value in the last record of field 'Lot No 'nd ( let say field ' A ' and
field ' B ' )
then paste them into a new record until the no of record is 5.

The expert,please help.



rahmad said:
rahmad said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top