Solved

Access If else if syntax problem

Posted on 2009-05-08
4
1,212 Views
Last Modified: 2012-05-06
Please help with troubleshooting my expression.

I have been asked to write the following statement and am having syntax problems:

The first segement below is my instruction and the second is what I have entered in the expression builder.  
[over60]
If debits(90)>=BAL
Then 	If (BAL-Over30)>0
                     then Over60=(BAL-Over30)
                     else Over60=0
Else over60=(Debits(90)-over30)
Endif
 
 
60To90DayDebits:Sum(IIf([Query1]![SumOf90To120DayDebits]>=[Dbo_Accounts!Balance], IIf([Dbo_Accounts!Balance]-[Query1]![SumOf30To60DayDebits]>0, [Dbo_Accounts!Balance] - [Query1]![SumOf30To60DayDebits]), 0),[Query1]![SumOf60To90DayDebits]-[Query1]![SumOf30To60DayDebits]))

Open in new window

0
Comment
Question by:kgittinger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 24338138
test this

60To90DayDebits:Sum(IIf([Query1]![SumOf90To120DayDebits]<[Dbo_Accounts!Balance], [Query1]![SumOf60To90DayDebits]-[Query1]![SumOf30To60DayDebits],IIf([Query1]![SumOf90To120DayDebits]>=[Dbo_Accounts!Balance] And [Dbo_Accounts!Balance]-[Query1]![SumOf30To60DayDebits]>0, [Dbo_Accounts!Balance] - [Query1]![SumOf30To60DayDebits], 0)))


or this shorter version

60To90DayDebits:Sum(IIf([Query1]![SumOf90To120DayDebits]<[Dbo_Accounts!Balance], [Query1]![SumOf60To90DayDebits]-[Query1]![SumOf30To60DayDebits],IIf([Dbo_Accounts!Balance]-[Query1]![SumOf30To60DayDebits]>0, [Dbo_Accounts!Balance] - [Query1]![SumOf30To60DayDebits], 0)))
0
 

Author Closing Comment

by:kgittinger
ID: 31579529
Looks great.  Thank you!
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24338243
did you also try did the shorter version?
0
 

Author Comment

by:kgittinger
ID: 24338397
Both produced the same results.  Thanks you again for all of your help.  
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question