Query to update table but no result

SJLyall

New member
Local time
Today, 03:16
Joined
Feb 25, 2015
Messages
4
Hi
I have a created a query which I want to update a table. The field is called DTP. I have the Workingdays2 module in place as well as the Holidays Table. The dates (date only) are called Time in and Transaction date. I want the table to upate records only if the entry in Completed is Yes. I have attached screenshot of what I have in query. I am no good whatsoever at VBA so I used the Query design view. It shows how many records will be updated (which is a valid number) and shows me which field will be updated. However when I run the query and then opend the Table the DTP field is empty. Anybody have any ideas please?

Thanks
 

Attachments

  • DTP.jpg
    DTP.jpg
    34.5 KB · Views: 102
you are updating DTP to a Boolean value

if dtp=workingdays.... it will update to -1 and if not it will update to 0

However your criteria is only selecting records where dtp is null and if you have a null in an equation, it will return null so you are updating with null

if you want it to update to the workingdays value, remove dtp= otherwise you need to remove the dtp criteria or change it to 'is not null'

incidentally, if you are going to continue to use it, your dtp criteria only needs to be 'is null'

With regards your completed value, for your criteria to work, completed needs to be text. If it is Boolean, than you should use yes, true or -1 (not quotes)
 
Excellent. Many thanks for your help. All OK now.
 

Users who are viewing this thread

Back
Top Bottom