?
Solved

Convert today's date to the number of the year

Posted on 2008-06-18
6
Medium Priority
?
583 Views
Last Modified: 2013-11-28
Hi experts:

I'd like to have this calculation: (date()-91)/365 in the report, like today is the 169th day of the year, the value should be 0.2137.. My expression didn't work, could experts help me?

Thank you!

LL
0
Comment
Question by:howruaz9
6 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 2000 total points
ID: 21816293
Give this a whirl...

CSng(DateDiff("d", #1/1/2008#, date) / 365)
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21816411
DatePart will be more generic:

CSng(DatePart("dy", date) / 365) 

Open in new window

0
 

Author Closing Comment

by:howruaz9
ID: 31468544
Thank you very much, it's working.

LL
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:howruaz9
ID: 21816528
Thank you, angelllll, I wish I could have more points to give.

LL
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21816611
no problem.
0
 
LVL 12

Expert Comment

by:nexusnation
ID: 21817009
Don't worry, a3 has more than enough. :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question