If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Query Field /w multiple criteria

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-19-12, 14:37
Dulanic Dulanic is offline
Registered User
 
Join Date: Dec 2011
Posts: 4
Query Field /w multiple criteria

OK I am very pretty new at Access as I have mostly always used Excel for most things. However, I am kind of stuck here. I need to write an expression /w multiple If conditions. Basically I have a dlookup field as so:

Ent Due Date: DLookUp("[Due Date]","tblTrainingDates","[Course ID] = '" & [Item Id] & "'")

Now I need to create another field based off of that.... if I was doing this in Excel it would be: =IF(AND(C2<>"",C2>B2),"Y","N") if C2 = [Ent Due Date] and B2 = [Completion Date].

Basic idea is I want a field saying "Y" IF [Completion Date] > [Ent Due Date] AND [Ent Due Date] Not Null.

I hope that makes sense....
Reply With Quote
  #2 (permalink)  
Old 01-19-12, 17:28
Sam Landy Sam Landy is offline
Registered User
 
Join Date: May 2004
Location: New York State
Posts: 931
Code:
FieldName = IIF(([Completion Date] > [Ent Due Date]) AND (Not IsNull([Ent Due Date])),"Y","N")
See the IIF() (Immediate If) function in the Help file for details.

Sam
Reply With Quote
  #3 (permalink)  
Old 01-19-12, 18:03
Dulanic Dulanic is offline
Registered User
 
Join Date: Dec 2011
Posts: 4
Well now I feel stupid lol... in hindsight that was kind of obvious.

Thanks for the help.
Reply With Quote
  #4 (permalink)  
Old 01-24-12, 15:53
Sam Landy Sam Landy is offline
Registered User
 
Join Date: May 2004
Location: New York State
Posts: 931
You're very welcome.

Welcome to Access!

Sam
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On