Problems with Update Query

  • Thread starter Thread starter Eric Wade
  • Start date Start date
E

Eric Wade

I'm trying to update a field in a table based off of
values in 2 other fields in the same table. I thought I
had got it to work, but when I changed some of the values
to test the query out, it didn't work as originally
intended. Here's the thing, and I might be putting this
expression in the wrong area.

Also, this database is based off of an Excel spreadsheet
that I am converting, so here goes:

Excel formula went as follows:

=IF(AND(D2>=today,E2="829"),1,0)

In Access, here is the above formula translated:

Update Field: New Request
Table: Data
Update To: "0"
Criteria: IIf([Data].[Comment Added Date]>=Date() And
[Data].[Action Code]="829",1,0)

Comment Added Date = D2 (in the excel formula)
Action Code = E2 (in the excel formula)

Can someone point me in the right direction here. Here is
what I envision this update query doing, and not sure what
I've done wrong.

I want based off the above criteria, if Comment Added Date
is greater than today, and Action Code is 829, to drop a
value of "1" in New Request, otherwise "0" value in New
Request.

Any help is appreciated, and will accept pointers in what
I did wrong. Thanks again!
 
You only need [New Request] in the query. Dont add the criteria in the
criteria row. Put it in the update row for [New Request].

Kelvin
 
i'm not familiar with how dates are handled in excel, but
in access your expression is saying that if the Comment
Added Date is IN THE FUTURE OF today....
will your comment added date ever be in the future of
today's date?
 
Back
Top