Updating records in a table

G

Guest

I want to create a query that will update all records in a table that are
null by an incremental value. In other words I'll run a report on Monday and
run a query that will assign a value of "1" for each of the seven records
that were entered that day. If I run a report on Tuesday I want a value of
"2" for each of the four records that were entered on Tuesday.

I'm using a yes/no feild on the table. When I run an update query the
records I've entered change to "yes" after I run a report. I just want Access
to recognize the records in the yes/no feild with a value of no and update
them by 1 in the record value field.

Remember, all seven records on Monday get a value of "1". The four records I
enter on tuesday get a value of "2" and so on.
 
F

fredg

I want to create a query that will update all records in a table that are
null by an incremental value. In other words I'll run a report on Monday and
run a query that will assign a value of "1" for each of the seven records
that were entered that day. If I run a report on Tuesday I want a value of
"2" for each of the four records that were entered on Tuesday.

I'm using a yes/no feild on the table. When I run an update query the
records I've entered change to "yes" after I run a report. I just want Access
to recognize the records in the yes/no feild with a value of no and update
them by 1 in the record value field.

Remember, all seven records on Monday get a value of "1". The four records I
enter on tuesday get a value of "2" and so on.

It's really not very clear what you are trying to do.

Records are not Null. Fields are Null.
WeekDay([DateField],2) will return a 1 for a Monday date, a 2 for
Tuesday date, etc.
What field is supposed to be updated to a 1 or 2 or 3....
Is it a Number datatype?
What field is supposed to be Null
Does the DateField contain the date of record Entry?

Perhaps:
"Update YourTable Set YourTable.AField = Weekday([DateField],2) Where
CheckBox = 0 and SomeField Is Null;"

A better method might be to just give that field a default value of 1
or 2, etc. and then overwrite it when data is entered into that
record.
Set the Default Property of that control to
WeekDay(Date(),2)
 

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