473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Year to Date Math

64
Access 2007

I have a program that calculates time efficiencies,(charged hours vs billed hours) over a date range. The date range is entered in an input form. Works fine. My question is, can I find a way to add Year To Date calculations without having to actually enter the first day of the year in the date range. In other words, can I create a field on the report that automatically shows me total hours worked Year To Date?

Thanks


-Tomb
Aug 8 '08 #1
6 4318
Here's a site with some sample date manipulation. You would just need to pass it the current year from the current date. Hope it helps.

http://www.cpearson.com/excel/DateTimeVBA.htm
Aug 8 '08 #2
NeoPa
32,556 Expert Mod 16PB
I expect so Tom.

What exactly is your algorithm for deciding hours worked Year-to-Date?
Aug 9 '08 #3
NeoPa
32,556 Expert Mod 16PB
PS. Did you realise when you chose TomB as your signature that it has an alternative, more morbid, interpretation?
Aug 9 '08 #4
tbeers
64
PS. Did you realise when you chose TomB as your signature that it has an alternative, more morbid, interpretation?

Actually, I am not aware of a more morbid interpretation....interesting.

At any rate, I have a report that computes various totals of data based on a date range that is entered by the user. I would like to include a YTD calculation without any addtional user input.

TomB
Sep 8 '08 #5
Stewart Ross
2,545 Expert Mod 2GB
Hiya TomB. It is certainly possible to do year-to-date calculations using a totals query to do so - but Access does not of itself know what year you may mean, so you need to store these details in a table. I do this for order processing, staff hours and other applications where the year is not the same as the calendar year; I store the year reference, the start date, and end date, and then join the date table to the relevant totals query where the dates of interest are between the start and end dates listed.

In the UK financial years typically run from 1 April to 31 March, but this is just a convention; the financial year of the college where I work actually runs 1 August to 31 July. The advantage of using a table to store such dates is that you can then use the dates stored for particular years to select the transactions that apply between these dates to view end-year totals, totals to date and so on.

(And by the way, NeoPa's comment about the connotations of your name resulted from signing yourself Tomb in post #1.)

-Stewart
Sep 8 '08 #6
NeoPa
32,556 Expert Mod 16PB
Stewart correctly interpreted the "morbid" reference, although having the 'B' in lower case would not have been necessary for the link (In case there's any doubt , I'm not poking fun at you or your name) ;)

Anyway, let us know if you have this sorted now. If not, explain clearly where you're stuck.
Sep 9 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: John Hunter | last post by:
>>> from datetime import date >>> dt = date(1005,1,1) >>> print dt.strftime('%Y') Traceback (most recent call last): File "<stdin>", line 1, in ? ValueError: year=1005 is before 1900; the...
7
by: Fendi Baba | last post by:
The function is called from opencalendar(targetfield). Thanks for any hints on what could be the problem. .............................................................. var...
12
by: Mark | last post by:
I feel embarassed asking such a simple question --- Year(Date()) returns 2004; I want only the last two digits. Format(Year(Date()),"yy") returns 05. How do I get 04? Thanks! Mark
2
by: Douglas | last post by:
I have a Vehicle MOT field in my table which i have as a Date field I dont really want to hold the year, just 'dd mmm' as MOTs are the same date every year. I have the field on my form as a...
6
by: PMBragg | last post by:
Thank you everyone that helped me with my DateSerial question. I really do appreciate it. Now my accountant has told I need to pull the inventory for just the year I'm depreciating. Is there a way...
2
by: Bernd Hohmann | last post by:
Dear collegues, small query problem. A table (simplified example)... customer as char(5) inv_date as date amount as double
6
by: Jim Stools | last post by:
Any idea how to find the year, month and day from (Int32) 38896? 38896 presents 6/28/2006 in excel. The dates in the database are (all) stored as Int32's corresponding to the way dates are handled...
4
by: RP | last post by:
I have a date entered in a TextBox. On this TextBox LostFocus, I want to retrieve the year part and then calculate the difference from current year.
14
by: Tommy Jakobsen | last post by:
Hi. Is there a method in .NET that takes "year" as an argument and returns the total number of weeks in that year? For culture da-DK (Danish). Thanks in advance. Tommy.
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.