How do I setup this MS Access Forumla

By zartitech ·
Hi all,

I'm building a report in access and I need some help on creating a formula. I'm counting how many open tasks our staff have in our database and I need counts for: Total, Due in next 7 days, due in 8-30 days, due in 31-60 days, and Over 60 days.

I have total, but I'm trying to write a formula that says: If the Target date is between today and today+7, then enter 1, else enter 0.

Is this the right way to do this?

Should I try something else?

And... what is the correct way to enter this formula?

*Access 2003

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

look up the datediff function

by Tony Hopkinson In reply to How do I setup this MS Ac ...

select DateDiff(day,[someDate],Date()) As DaysOld From SomeTable.

After that there's a lot of ways to go

Case When DaysOld < 8 Then 'Due in 7 days'
Case When DaysOld < 31 Then 'Due in 30 days'
end as targetRange

Don't ask me how to get this in the graphical front end though, I's a sql guy.

Related Discussions

Related Forums