By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,662 Members | 1,758 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,662 IT Pros & Developers. It's quick & easy.

Expression Builder Question

P: 1
I have a rether simple, straight-forward Access database and need to include a calculated field in the report. My Access skills are elementary, ergo the need for assistance.

I have a "Date_Received" field [date format] and an "Inventoried" field [T/F]. I need assistance in building an expression in the calculated field something like this:
Expand|Select|Wrap|Line Numbers
  1. IF INVENTORIED<>T THEN
  2. DATE() - DATE RECEIVED
  3.  
I can not figure out how to accomplish this. Help would be most appreciated!

h
Sep 11 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 296
I have a rether simple, straight-forward Access database and need to include a calculated field in the report. My Access skills are elementary, ergo the need for assistance.

I have a "Date_Received" field [date format] and an "Inventoried" field [T/F]. I need assistance in building an expression in the calculated field something like this:

IF INVENTORIED<>T THEN
DATE() - DATE RECEIVED

I can not figure out how to accomplish this. Help would be most appreciated!

h
The syntax for an if statement in Access goes like this:
iif([Condition], [Value if True], [Value if False])

So in your case, it would go something like:
iif([Inventoried]="T", Date() - [Date_Received], "")

Note that if you want something returned if [Inventoried]="F" then you will need to replace the empty string ("") with that value. Also note the two i's in the word IIF.
Sep 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.