I
ironwood9 via AccessMonster.com
I have a table with three Yes/No fields used as “flags†…. I run a update
queries to set the value of these fields to True if certain criteria is met.
There are three update queries with slightly different criteria, and each one
updates a different one of the 3 yes/no fields – is there a way to combine
the 3 queries ?
The function named fNetWorkDays calculates the number of working days
– if the number equals 3, then I want to check the “Call1†field in tblMain.
If the number equals 6, then I want to check the “Call2†field, and so on –
here’s the code for the 3 queries:
Query 1:
UPDATE tblMain SET tblMain.Call1 = -1, tblMain.DateUpdated = Now()
WHERE (((tblMain.Call1)=0) AND ((fNetWorkdays([DtStartDate],Date(),True))=
3))
Query 2:
UPDATE tblMain SET tblMain.Call2 = -1, tblMain.DateUpdated = Now()
WHERE (((tblMain.Call2)=0) AND ((fNetWorkdays([DtStartDate],Date(),True))=
6));
Query 3:
UPDATE tblMain SET tblMain.Call3 = -1, tblMain.DateUpdated = Now(),
WHERE (((tblMain.Call3)=0) AND ((fNetWorkdays([DtStartDate],Date(),True))=
9));
queries to set the value of these fields to True if certain criteria is met.
There are three update queries with slightly different criteria, and each one
updates a different one of the 3 yes/no fields – is there a way to combine
the 3 queries ?
The function named fNetWorkDays calculates the number of working days
– if the number equals 3, then I want to check the “Call1†field in tblMain.
If the number equals 6, then I want to check the “Call2†field, and so on –
here’s the code for the 3 queries:
Query 1:
UPDATE tblMain SET tblMain.Call1 = -1, tblMain.DateUpdated = Now()
WHERE (((tblMain.Call1)=0) AND ((fNetWorkdays([DtStartDate],Date(),True))=
3))
Query 2:
UPDATE tblMain SET tblMain.Call2 = -1, tblMain.DateUpdated = Now()
WHERE (((tblMain.Call2)=0) AND ((fNetWorkdays([DtStartDate],Date(),True))=
6));
Query 3:
UPDATE tblMain SET tblMain.Call3 = -1, tblMain.DateUpdated = Now(),
WHERE (((tblMain.Call3)=0) AND ((fNetWorkdays([DtStartDate],Date(),True))=
9));