Solved

Access If else if syntax problem

Posted on 2009-05-08
4
1,195 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
  • 2
  • 2
4 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero 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 119

Expert Comment

by:Rey Obrero
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now