Nested Query Help Needed

Corey

Registered User.
Local time
Yesterday, 20:15
Joined
Sep 14, 2005
Messages
35
Hello everyone,

I’m looking for some help with a “nested query”

I have four fields that typically have a quantity amount in them.

I also have a field with a date.

I would like to say something like this

If fielda = 0 and fieldb = 0 and field = 0 and fieldd = 0 and in the date field, the date is >30day from today’s date add a 1 to this field, otherwise leave it blank


Thanks a lot

Corey
 
Update MyTable
SET MyField = MyField + 1
WHERE fielda = 0
and fieldb = 0
and fieldc = 0
and fieldd = 0
and dateadd("d",30,date()) < datefield
 
Not sure if the syntax is correct but something like this should work


iif([fielda]=0 and iif([fieldb]=0 and iif([fieldc]=0 and iif([fieldd] =0 and iif([datefield] > Date()+30,[thisfield] +1,null)))))
 

Users who are viewing this thread

Back
Top Bottom