Number of rooms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to figure out how to get access to calculate the number of rooms
(which is 178), times the today-1 times the number of months so far for this
year to get a total like let's say today is the 27th, of September, which
would mean 178*26(days)*9(September being the 9th month). I am using this
formula for Month to Date Caluculations =178*(Day(Date()-1)), which seems to
work fine, but I can't seem to get my head around a Year to date Calculation,
since some days have 30 days, some 31, and then there's Febuary. Any
suggestions would be appreciated.

Thx
Eric
 
A Correction, the formula I'm using for Month to day is:
=IIf(Day(Date())=1,Month(Date())-1,Day(Date())-1)*178
 
I think I found a way do to what I want to do, I added a "Day" Field to one
of my tables with a default of one, and through a query that calculates the
year to date total. It's not clean but it should work.
 
I can't seem to get my head around a Year to date Calculation,
since some days have 30 days, some 31, and then there's Febuary.

To get the number of days so far in the year you can use

DateDiff("d", DateSerial(Year(Date()), 1, 1), Date())

For month to date, you can similarly use

DateDiff("d", DateSerial(Year(Date()), Mnnth(Date()), 1), Date())


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top