473,387 Members | 1,892 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,387 software developers and data experts.

difference between dates - for a beginner!

Hi everyone - I've been using a simple Access 2000 database table for some time for data for animal breeding programme. Every breeding animal has an individual record for each time there is a birth, showing the number born ... and so on. What I want to be able to do is to work out the amount of time - say as a fraction of a year - between the first and the last birth, bearing in mind that there may be anything from 3 to 10 births for any particular animal. Help please - and you need to know I'm not into programming language etc.
Thanks in anticipation!
Nov 13 '06 #1
5 2131
NeoPa
32,556 Expert Mod 16PB
DeeBees,

Can you post the details of your record structure so far?
It does make helping easier.

Refer to this post for guidance (POSTING GUIDELINES: Please read carefully before posting to a forum).
Nov 13 '06 #2
DeeBees,

Can you post the details of your record structure so far?
It does make helping easier.

Refer to this post for guidance (POSTING GUIDELINES: Please read carefully before posting to a forum).
Okay - columns across from LHS are
1. Parent ref number in question (text)
2. date mated (the first entry will be the starting point)
3. who mated to (text)
4. Date of resulting birth
5. No born alive (numeric)
6. No alive at 12 weeks (numeric)

There will be several lines of entires of successive matings and the resulting data. I want to be able to work out the time period between first and last matings and then divide that into the sum of the numbers alive at 12 weeks to get an annualised "going rate".

Sorry if this is very amateur to you highly experienced professionals - I have tried getting sense from the Access "help" files without any real success so far. Thanks again in anticipation!
Nov 13 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
Okay - columns across from LHS are
1. Parent ref number in question (text)
2. date mated (the first entry will be the starting point)
3. who mated to (text)
4. Date of resulting birth
5. No born alive (numeric)
6. No alive at 12 weeks (numeric)

There will be several lines of entires of successive matings and the resulting data. I want to be able to work out the time period between first and last matings and then divide that into the sum of the numbers alive at 12 weeks to get an annualised "going rate".

Sorry if this is very amateur to you highly experienced professionals - I have tried getting sense from the Access "help" files without any real success so far. Thanks again in anticipation!
Try something like this:

SELECT [Parent ref number in question], Max([date mated]) - Min([date mated]) As NoDaysMating, Sum([No alive at 12 weeks]) As Alive12Wks, (Alive12Wks / NoDaysMating) As goingRate
FROM TableName
GROUP BY [Parent ref number in question];
Nov 13 '06 #4
I really do appreciate your help - looks like we got there! Thanks so much.
Nov 15 '06 #5
MMcCarthy
14,534 Expert Mod 8TB
I really do appreciate your help - looks like we got there! Thanks so much.
No problem. Glad I could help.
Nov 15 '06 #6

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

Similar topics

26
by: Frank | last post by:
For my website i would like to display the age of my son in years, months, days and hours. For now i manage to get a result for totals. Like the total number of days. This is the beginning: ...
8
by: Mojca | last post by:
What is formula that get days between two dates? Npr: 11.03.1998 – 1.7.2005 Thank you, Mojca
6
by: Ashish Sheth | last post by:
Hi All, In C#, How can I get the difference between two dates in number of months? I tried to use the Substract method of the DateTime class and it is giving me the difference in TimeSpan,From...
4
by: jamesyreid | last post by:
Hi, I'm really sorry to post this as I know it must have been asked countless times before, but I can't find an answer anywhere. Does anyone have a snippet of JavaScript code I could borrow...
4
by: Yotam | last post by:
Hi, I need some help with JS. I will be grateful, if you can help me out. I have two date fields (check in, check out) and "number of days" field. I want the script to calculate automatically...
2
by: Blackmore | last post by:
I am trying to use javascript to calculate the difference between two form inputted dates and return the result to another form object. When I load up the page with the function on my web browser...
8
by: Claudia Fong | last post by:
Hi, In VB we have DateDiff to calculate the days difference between 2 dates, I was wondering if we have something like that in C#? I want to calculate for example the days difference...
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi, misters which the best method for get the difference (in days) of two dates. The hour (hh:mm) don't mind, would be 00:00 for all dates. 1.) fechaUno.Substract(fechaDos).Days 2.)
4
by: Charlote | last post by:
Hello, I am a beginner in python, and have a question.. I need to create a list of all dates between two dates.. Lets say beggining date= 2008-1-15 enddate= 2008-2-20 how do I...
4
by: sniipe | last post by:
Hi! I am new in Python, so I count for your help. I need to get difference in months between two dates. How to do it in python? I am substracting two dates, for example date1 - date2 and I got...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.