how to write condition in a query

  • Thread starter Thread starter xiaodan86
  • Start date Start date
X

xiaodan86

If I wan to perform some calculation in the query if the condition
meet, how can combine the below statement tgt in one field?

Minutes: IIf([start]>DateAdd("d",-1,[forms]![datedaily1]![date] And
[end]<[forms]![datedaily1]![date]),DateDiff("n",[start],[end]))

Minutes: IIf([start]<DateAdd("d",-1,[forms]![datedaily1]![date] And
[end]<[forms]![datedaily1]![date]),DateDiff("n",DateAdd("d",-1,[forms]!
[datedaily1]![date],[end]))

Minutes: IIf([start]<DateAdd("d",-1,[forms]![datedaily1]![date] And
[end]>[forms]![datedaily1]![date]),3600)

Minutes: IIf([start]>DateAdd("d",-1,[forms]![datedaily1]![date] And
[end]>[forms]![datedaily1]![date]),DateDiff("n",[start],[forms]!
[datedaily1]![date]))

Any syntax needed in order to combine "IIf" statement?
 
Already answered in another newsgroup.

If you feel your situation calls for posting in more than one newsgroup
(rarely necessary), post to all you select with a single post. That way, an
answer in one shows up in all. And the volunteers here don't duplicate each
other's efforts answering a post already answered.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
Back
Top