Re: Do While Loop code
- From: "JimBurke via AccessMonster.com" <u49905@uwe>
- Date: Thu, 09 Jul 2009 15:42:41 GMT
After thinking about it, this will include all transactions past 60 days due
in the number for past 30 days. Not sure if you would want that or not. If
not then you would want to change the one for past 30 to be
Sum(IIf(Now()-[DateRequested]>=30 and Now()-[DateRequested]<=59 ,1,0)) AS
Past30
JimBurke wrote:
From what I can gather, this form is bound to a table that consists oftransactions, and you merely need to count the number of them as well as the
ones 30 and 60 days past due. Is that the case? If so, you should just do it
through a query. This should work if I'm right about what you're doing
SELECT Count(*) AS MyCount, _
Sum(IIf(Now()-[DateRequested]>=30,1,0)) AS Past30, _
Sum(IIf(Now()-[DateRequested]>=60,1,0)) AS Past60
FROM yourTableName
I would just create a stored query from that SQL.
Then you can either open a recordset on that query and retrieve the values
thru the recordset or else do DLookups:
transCount = DLookup("myCount","thatQueryName")
past30 = DLookup("Past30","thatQueryName")
past60 = DLookup("Past60","thatQueryName")
I have a menu type form, and on it there is a spot to count how many[quoted text clipped - 28 lines]
outstanding transactions there are. What I am trying to do is get a total
txt60Days = Days60 & " are over 60 days old" 'txt60Days is field on form
End Sub
--
Jim Burke
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200907/1
.
- Follow-Ups:
- Re: Do While Loop code
- From: JWhitehead
- Re: Do While Loop code
- References:
- Do While Loop code
- From: JWhitehead
- Re: Do While Loop code
- From: JimBurke via AccessMonster.com
- Do While Loop code
- Prev by Date: Re: Lost Records
- Next by Date: Re: custom INSERT INTO TABLE statement for ACCESS 2003
- Previous by thread: Re: Do While Loop code
- Next by thread: Re: Do While Loop code
- Index(es):
Relevant Pages
|