Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF Help

Status
Not open for further replies.

Perlyman

IS-IT--Management
Jan 2, 2002
8
US
I am having trouble with a query. I am trying to Avoid using a crosstabv query.

Here's what I am trying to do:

Past Due: IIf([Due Date]<Date(),[Balance],0)

1 Week: IIf([Due Date]>(Date()-1) And [Due Date]<([Due Date]+8),[Balance],0)

2 Week: IIf([Due Date]>(Date()+7) And [Due Date]<([Due Date]+15),[Balance],0)

The Past due works fine, but the 1 week and 2 week return all records?

Any help appreciated
 
Due Date can't be less than itself. I think you mean Date() as shown here:

1 Week: IIf([Due Date]>(Date()-1) And [Due Date]<(Date()+8),[Balance],0)

2 Week: IIf([Due Date]>(Date()+7) And [Due Date]<(Date()+15),[Balance],0)




I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
Just try flipping your > into < and your < into >.

I know it doesn't makes sense, but after using COBOL, I'm used to things not making sense. :-D

-------------------------
Just call me Captain Awesome.
 
Try changing this part in both queries:
Code:
IIf([Due Date]>(Date()-1) And [Due Date]<([COLOR=red][Due Date][/color]+8),[Balance],0)

to 

IIf([Due Date]>(Date()-1) And [Due Date]<([COLOR=red]Date()[/color]+8),[Balance],0)

traingamer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top