auto populating fields in sql 2000 (1 Viewer)

superblades

New member
Local time
Today, 16:42
Joined
Sep 20, 2006
Messages
9
Hi,

I wondering if someone can help me as im a complete newbie :)

Ive upsized a database from access to sql 2000 and i had a bit of code written in vb that once i changed a particular field in a table it automatically inserted todays date into another field, i know it still works if i work with it as an access project but im trying to get completely away from access.

e.g.

i have a table called tbl_req and a table called tbl_status

in the tbl_req table i have a field called fld_status which is linked to the tbl_status table and it basically contains a unique ID and a string e.g.

tbl_status

unique id - status
1 - completed
2 - cancelled
3 - ordered

etc...

what i want to happen is when someone selects a different status in the tbl_req table it automatically inserts todays date in another field called fld_statuschgd in the tbl_req table.

e.g.

tbl_req

fldstatus - fldstatuschgd
ordered - 12/12/2006

if i now changed from ordered to completed the below should happen

completed - 03/01/2007

etc...

ive no idea if i need to use triggers or stored procedures etc.

any help would be most appreciated

many thanks

Brendan Tate
 

Users who are viewing this thread

Top Bottom