Copy a date from a cel to another depending on another cel.

M

MyVi

Hi everyone.

How would you do this?

Cómo hariais esto?

ID PRODUCT DATE
1 1 ..
2 1 ..
3 1 ..
4 2 ..
5 2 ..
6 2 ..
7 2 ..

In this table I would like to inpit a DATE into the ID1 (for instance)
and to get this date copied into the other cels with the same product.
Exemple: If I put 10-10-05 into ID1, it would be this date copied into
the cels of ID2 and ID3 ('cause it is the same product), but not into
ID4,5,6 & 7 due to the product is another.
I'm using this information into a form, but previosly filtered for a
query.

Thank you
Vic
 
D

Douglas J. Steele

Use an UPDATE query.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Hi everyone.

How would you do this?

Cómo hariais esto?

ID PRODUCT DATE
1 1 ..
2 1 ..
3 1 ..
4 2 ..
5 2 ..
6 2 ..
7 2 ..

In this table I would like to inpit a DATE into the ID1 (for instance)
and to get this date copied into the other cels with the same product.
Exemple: If I put 10-10-05 into ID1, it would be this date copied into
the cels of ID2 and ID3 ('cause it is the same product), but not into
ID4,5,6 & 7 due to the product is another.
I'm using this information into a form, but previosly filtered for a
query.

Thank you
Vic
 
M

MyVi

Hi douglas.
Thank you for helping me.

But my level of access is not such high. Could you be more specific?

"use and UPDATE query".
Good, but how should I do that?

Thank you

Vic
 
C

Chris2

MyVi said:
Hi douglas.
Thank you for helping me.

But my level of access is not such high. Could you be more specific?

"use and UPDATE query".
Good, but how should I do that?

Thank you

Vic

MyVi,

The basic syntax of an UPDATE query is as follows.


UPDATE <table>
SET <column>
|,<column>...|
WHERE <criteria>


Example

CREATE TABLE OrderDetails
(OrderDetailID AUTOINCREMENT
,OrderID INTEGER
,OrderPlaced DATETIME
,ProductID INTEGER
,Quantity INTEGER
,CONSTRAINT pk_OrderDetails PRIMARY KEY (OrderDetailID)
)

Note: The FOREIGN KEY CONSTRAINTs for OrderID and ProductID have been
omitted for brevity.

Sample Data:

1, 5, 10/29/2005, 10, 1


Query:

UPDATE OrderDetails
SET Quantity = 20
WHERE OrderID = 5
AND ProductID = 10


Output:

1, 5, 10/29/2005, 10, 20


Sincerely,

Chris O.
 
A

Amy Blankenship

Go to the Queries tab. Double-click "New Query in Design View." Select
the table you want to update from the dialogue, and close the dialogue.

Go to Query in the Menu, and change it to update. Now double-click the
field you want to update. You'll notice it appears in the query grid below.
In the Update to row, type the name of the cel you want to update from. Now
double-click the field name you want to use as the criteria. In the
Criteria row, type the value you want to use to tell Access when to update.

HTH;

Amy
 

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