Possible DCount?

Sgt Bilkp

Registered User.
Local time
Today, 18:34
Joined
Jan 11, 2008
Messages
66
Hi again. Just dragged out an old DB that ended up on the bottom of the pile.

I need to do a simple count up in a different form of values in "frmFaults", but only for records with a start date within the last 12 months.

Eg in "frmFaults"

Date_down = 1/2/06 Days_Lost 12
Date_down = 20/8/07 Days_Lost 5
Date_down = 1/2/08 Days_Lost 22

I need the count up to only add 20/8 and 1/2 = 27

Anyone?
 
Sarge,

Paste something like this in the query grid:

Code:
Select Sum(Days_Lost)
From   YourTable
Where  DateDiff("d", Date(), Date_Down) < 365

It should get you started,
Wayne
 
Sarge,

Paste something like this in the query grid:

Code:
Select Sum(Days_Lost)
From   YourTable
Where  DateDiff("d", Date(), Date_Down) < 365
It should get you started,
Wayne

I only want the value to appear in a text box. How do i get to the query builder from a text box?
 
Sarge,

Code:
Me.txtBox = Dsum([Days_Lost], "YourTable", "DateDiff("d", Date(), Date_Down) < 365")

Wayne
 

Users who are viewing this thread

Back
Top Bottom