General :: Calculating Gaps Between Memberships

Oct 5, 2012

Calculation I am finding incredibly tricky. I am looking at peoples memberships, so have data structured like this:

Person ID Membership ID Membership Start Date Membership End Date
112233 98765 01/01/11 31/01/11
112233 12345 01/03/11 31/05/11
112233 67890 01/05/11 31/05/11

So, people can have had more than one membership.

What I am trying to find is the difference between the start date and end date of the memberships, and see if any were overlapping. So in the example above I would like to start at the first membership and compare this to the second, so the answer is 1 month difference between end date and next start date, then compare the second to the third, so the answer is -1 month between end date and start date.

View Replies


ADVERTISEMENT

Find Gaps Between Activities

Dec 17, 2007

I've got a table 'Activity' with around 9000 records built up over the past 18 months. Each record has three fields: ID (autonumber), Start (datetime) and End (datetime). An activity can start and end at any time (denoted Start and End), and be of any duration. Generally there are several activities underway, but occasionally nothing's happening.

What I'm struggling to do is create a query which returns the Start and End date/time of each 'gap' - i.e. all the periods when there was no activity.

I assume this requires 2 instances of the table so that the end of each activity can be compared with all the other Start / Ends to see if it falls in a gap, but nothing works so far, so grateful for any help.

View 2 Replies View Related

Auto-fill In The Gaps - Advise Plz

May 12, 2005

i have a query that provides data like so:

IDNumber - Units - WeekNo
55643 - 180 - 1
55643 - (Null) - 2
55643 - (Null) - 3
55643 - 135 - 4
55643 - (Null) - 5
55643 - 0 - 6
55643 - (Null) - 7

is there a way of adding something to the SQL to make it fill in the Null values to the most previous value of Units? in other words, the top 2 Null's would become 180, the next one down would become 135 and the bottom one would become 0.

since data is not entered weekly, these Null's are inherently there for certain weeks and i am hoping that with the Nulls replaced, i can produce a bar chart from this query for a report. if the Null's remain, i am getting 'gaps' in my chart which look like zero's.

many thanks.

View 2 Replies View Related

Gaps In Between Tables On Html Email Template

Sep 21, 2006

my html template is built inside access.. the form button is clicked and the template opens in outlook.

it looks fine in outlook.. so i send the email.. when i receive the email in outlook, it looks fine..

here is what it looks like

http://www.londonheathrowcars.com/image2.jpg

however, i sent the same template to a gmail and hotmail address to see what it looks like..

it looks fine in hotmail
http://www.londonheathrowcars.com/image3.jpg

however in gmail it looks like this..

http://www.londonheathrowcars.com/image1.jpg

now, these gaps are appearing in between tables..

<table>blablabl</table>GAP<table>...

now, my question is.. is there anything i can add to the code that will remove these gaps..
i know my code is messy.. at the moment however it begins with <table> and ends with </table> (the main wrap table)

i realise i may need to add some kind of html type or something, but i dont know what..

as always, if anyone can shed some light on this matter i would be ever grateful..

thank you

below is the code

CODE
Option Compare Database

Private Sub emailbutton_Click()
'References: Oulook Library
Dim strEmail, strSubject As String, strBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

strEmail = Me.emailadd

strBody = "<table border='1' width='610' id='table1' cellspacing='0' cellpadding='5' bordercolor='#5A79B5' align='left'><tr><td align='center'><table border='0' width='600' id='table2' cellspacing='0' cellpadding='0'>" & _
"<tr><td width='300' height='61'>&nbsp;</td><td width='300' height='61' align='center'><img border='0' src='http://www.londonheathrowcars.com/emaillogosmall.gif' width='300' height='61'></td></tr><tr><td width='300' height='30'><font size='2' face='Arial' color='#000080'>FAO</font></td>" & _
"<td width='300' height='30' align='center'><b><font face='Arial' color='#5A79B5'>-------- London Heathrow Cars --------</font></b></td></tr></table><table border='0' width='600' id='table3' cellspacing='0' cellpadding='0'><tr><td>&nbsp;</td></tr><tr>" & _
"<td><font size='2' face='Arial' color='#000080'>Thank you for your booking request via our website.<br>Details of the requested transfer and our fare are as follows:</font></td></tr><tr><td>&nbsp;</td></tr><tr><td><hr color='#5A79B5'></td></tr></table>" & _
"<table border='0' width='600' id='table4' cellspacing='0' cellpadding='0'><tr><td width='200' height='20'><font size='2' face='Arial' color='#000080'><b>Job Date:</b></font></td><td width='400' height='20'><font size='2' face='Arial' color='#000080'>&nbsp;&nbsp;This</font></td>" & _
"</tr><tr><td width='200' height='20'><font size='2' face='Arial' color='#000080'><b>Pickup Time:</b></font></td><td width='400' height='20'><font size='2' face='Arial' color='#000080'>&nbsp;&nbsp;This</font></td></tr><tr><td width='200' height='20'>&nbsp;</td><td width='400' height='20'>&nbsp;</td>" & _
"</tr><tr><td width='200' height='20'><font size='2' face='Arial' color='#000080'><b>From:</b></font></td><td width='400' height='20'><font size='2' face='Arial' color='#000080'>&nbsp;&nbsp;This</font></td></tr><tr><td width='200' height='20'>&nbsp;</td><td width='400' height='20'>&nbsp;</td>" & _
"</tr><tr><td width='200' height='20'><font size='2' face='Arial' color='#000080'><b>To:</b></font></td><td width='400' height='20'><font size='2' face='Arial' color='#000080'>&nbsp;&nbsp;This</font></td></tr><tr><td width='200' height='20'>&nbsp;</td><td width='400' height='20'>&nbsp;</td>" & _
"</tr><tr><td width='200' height='20'><font size='2' face='Arial' color='#000080'><b>Vehicle:</b></font></td><td width='400' height='20'><font size='2' face='Arial' color='#000080'>&nbsp;&nbsp;This</font></td></tr><tr><td width='200' height='20'><font size='2' face='Arial' color='#000080'><b>Set Fare:</b></font></td>" & _
"<td width='400' height='20'><font size='2' face='Arial' color='#000080'>&nbsp;&nbsp;This</font></td></tr></table><table border='0' width='600' id='table5' cellspacing='0' cellpadding='0'><tr><td><hr color='#5A79B5'></td></tr><tr><td>&nbsp;</td></tr><tr><td>" & _
"<font size='2' face='Arial' color='#000080'>Our drivers are courteous, experienced and smartly presented. In addition, all of our vehicles are modern, clean and comfortable. To book this transfer, kindly reply to this email or call us on the following:</font></td>" & _
"</tr><tr><td>&nbsp;</td></tr><tr><td><table border='0' id='table9' cellspacing='0' cellpadding='0'><tr><td width='150'><b><font face='Arial' size='2' color='#000080'>Freephone (UK Only):</font></b></td><td width='150' align='left'><b><font face='Arial' size='2' color='#000080'>" & _
"&nbsp;&nbsp;0800 505 3231</font></b></td></tr><tr><td width='150'><b><font face='Arial' size='2' color='#000080'>International:</font></b></td><td width='150' align='left'><font face='Arial' color='#000080' size='2'><b>&nbsp;&nbsp;+44 (0) 208 814 2727</b></font></td></tr></table></td>" & _
"</tr><tr><td>&nbsp;</td></tr><tr><td><hr color='#5A79B5'></td></tr><tr><td><b><font size='2' face='Arial' color='#5A79B5'>Hasan Karim - Operations<br>London Heathrow Cars<br>&nbsp;</font></b></td></tr></table><table border='0' width='600' id='table10' cellspacing='0' cellpadding='0'>" & _
"<tr><td><table border='0' width='325' id='table11' cellspacing='0' cellpadding='0'><tr><td width='75'><font face='Arial' color='#5A79B5'><span style='font-size: 8pt'>Address:</span></font></td><td width='250'><span style='font-size: 8pt; font-family: Arial; color: rgb(90, 121, 181);'>" & _
"&nbsp;&nbsp;Suite 7, Jolyon House, Amberley Way, TW4 6BH</span></td></tr><tr><td width='75'><font face='Arial' color='#5A79B5'><span style='font-size: 8pt'>Phone:</span></font></td><td width='250'><span style='font-size: 8pt; font-family: Arial; color: rgb(90, 121, 181);'>&nbsp;&nbsp;+44 (0) 208 814 </span>" & _
"<span style='font-family: Arial; font-size: 8pt; color: #5A79B5'>2727</span></td></tr><tr><td width='75'><font face='Arial' color='#5A79B5'><span style='font-size: 8pt'>Fax:</span></font></td><td width='250'><span style='font-size: 8pt; font-family: Arial; color: rgb(90, 121, 181);'>" & _
"&nbsp;&nbsp;+44 (0) 208 399 6500</span></td></tr><tr><td width='75'><font face='Arial' color='#5A79B5'><span style='font-size: 8pt'>Web:</span></font></td><td width='250'><span style='font-family: Arial; font-size: 8pt; color: #5A79B5'>&nbsp;&nbsp;http://www.LondonHeathrowCars.com</span></td></tr><tr>" & _
"<td width='75'><font face='Arial' color='#5A79B5'><span style='font-size: 8pt'>Email:</span></font></td><td width='250'><span style='font-family: Arial; font-size: 8pt; color: #5A79B5'>&nbsp;&nbsp;info@LondonHeathrowCars.com</span></td></tr></table></td></tr></table></td></tr></table>"

strSubject = "London Heathrow Cars - Booking Request"
With objEmail
.To = strEmail
.Subject = strSubject
.HTMLBody = strBody
'.Send 'Will cause warning message
.Display
End With

Set objEmail = Nothing
End Sub

View 1 Replies View Related

General :: Calculating Percentage - Getting Error

Jul 6, 2012

I'm guessing it's a syntax problem.

This one doesn't give me an error, its just blank:

=Count("[QueryName]![QueryField]='String'")

This one gives me an Error. It's supposed to calculate a percentage. [ReportField] is working properly:

=[ReportField]/Sum([QueryName]![QueryField])

View 9 Replies View Related

General :: Calculating Balance For Payments In Installments

Jul 16, 2014

I have a project to take. It relates to school fee payments by students. I have created tables, query and forms for the same. The database is able to calculate the Balance using the query. Now my major issue is how do I go about Calculating the Balance for the second fee payment, given that the amount payable on the next payment will be the previous balance. I have tried to think using the nested if to try it, but invain!

View 4 Replies View Related

General :: Staff Table - Calculating Average Weekly Hours

Mar 4, 2015

I have a table with staff in.

I have a table with the start and end of their shifts.

We have four possible locations and four weeks.

So I have four tables for each location.

I have a module that can work out hours and deductions based on time in and out. I built that into a seperate databse working on a one time in and one time out setup.

I want to incorporate the two so I can get the hours worked over four weeks at all locations and divide that by 4 to get the average weekly hours for a staff member.

View 8 Replies View Related

General :: Calculating Stock Level For Spare Parts From Transactions

Jun 19, 2012

I am trying to calculate the stock level for my spareparts. I am aware of that I am not to update the stock level in my table but calculate the total from the transactions.

View 9 Replies View Related

General :: Calculating Number Of Weeks Between Start And Finish Date

Jun 9, 2015

I am calculating number of weeks between start and finish date. Some of the users have questioned the validity of calculation as they are not too sure if this is being calculated as Monday to Friday week or does it work by calculating 7 days. If the latter is true, then I should see a decimal value. I am using date diff formula.

View 12 Replies View Related

Calculating

Feb 19, 2007

I have a table with 2 coloums with nuberin them. I would like to add those 2 number together and display them in a 3rd coloum. I need to automatically change the 3rd coloums value should any others change. Is this possible?

View 4 Replies View Related

Calculating Age.

Jan 19, 2007

age: DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd"))Dob is stored yyyyddmmI thought this above function looks ok. When I run it, I get a data type mismatch in criteria expression.What am I missing?Any help would be appreciated.Thanks

View 6 Replies View Related

Calculating In VBA

Sep 20, 2005

hi all,

i have a mainform with a subform.

in the subform i have 2 fields: duur and subtotaal
in duur i enter a number.
in subtotaal a calculation has to occur: =20*([duur]/60)
i tried to do this calculation in VBA but then i got the same value on every record in the subform.

But now the problem:
in the mainform i have a control 'totaal' that needs to do a DSum of subtotaal.
And here i am getting into troubles since subtotaal is not stored in the table but calculated.

The formulla for DSum would be:
Me.Parent!totaal = DSum("subtotaal", "tblFacturenDetail", "[FactuurID] = " & Me.Parent!FactuurID)

but as said, subtotaal is not stored.

How should i proceed?

Thanks!

View 2 Replies View Related

Calculating An Age

Jan 6, 2005

If I want to work out how old all my patients will be on the 01 Feb 2005 then why doesn't the expression (in a query)

=(01/02/2005 -[tblPatient]![DateOfBirth]))/365.25 work?

How would I get the answer expressed in months?

View 1 Replies View Related

Calculating Totals

Jun 28, 2005

I am designing a new database for our life and disability department and they have several different policies where the base life insurance reduces at certain ages.

Please take a look at the scenarios listed below and give me any suggestions and tips on the best way to get this done. If you have any.

Below are the 12 scenarios:

1.) Reduces 75% at Age 70

2.) Age 65 to 70 the life amount is $9,000 and Age 70 and over the life amount is $6,000

3.) Reduces at age 65 by 92%, age 66 by 84.64%, age 67 by 77.869%, age 68 by 71.639%, age 69 by 65.908% and age 70 and over by 40%.

4.) On the day following the 70th birthday, the life amount will reduce to 70%. On the day following the 75th birthday the life amount will reduce to 40% of the 70th birthday reduced amount.

5.) On the Policy Anniversary Date following the 70th birthday - reduces 50%

6.) On the Premium Due Date following the 70th birthday, the life amount will reduce to 70%. On the Premium Due Date following the 75th birthday, life amount will reduce to 40% of the amount of the 70th birthday reduced amt.

7.) Age 65 life amount reduces to 65%. Age 70 life amount reduces to 35%. Age 75 life amount reduces to 25%.

8.) Terminates on the first of the month following the 65th birthday.

9.) Terminates Age 70

10.) Terminates on date of retirement or 1st or month following 70th birthday

11.) Terminates Age 65

12.) Never Reduces

Thanks for your time, Brian

View 2 Replies View Related

Calculating Averages

Nov 5, 2006

I have a database containing values in 16 fields. the fields are filled in over a period of three years. I would like to be able to calculate the average of the last four values entered, regardless of when in the cycle the value is required. I have tryed to use quereies but connot find away to assign the four fields to the expression so that it is the last four values and if four don't exist, avearage what values there are.

View 2 Replies View Related

Calculating Timespent Help Need

Dec 21, 2006

Hi,

I am new to Microsoft Access (2002) and the Access Word Forums. I am in need of a way to calculate timespent on six main topics through an 8 hr. working day. If I worked on Topic "A" from 8:00am to 8:15am, I need it to calculate it to 15 minutes. Then I need to figure a way to calculate how much time was spent doing Topic "A" for the working day, then by the workweek, then by the month.

I'm willing to learn, if someone has the time to teach or can direct me to a link that discusses something similar to what I am looking for. Any and all suggestions welcomed. I am looking forward to doing this in a timesheet format if possible.

Thank you,

Marty6

View 2 Replies View Related

Calculating Across Tables

Mar 17, 2008

Hi,
I think this should be simple, but I am struggling to work it out

In a relational database I have a stock table containing stock and quantities, there is a customer table with an order table used as the link table also containing quantities.

What I am trying to do is place an order using an order form linked to the order table, automatically reducing the stock table by the amount ordered.

I have tried an update query with no success, also tried using the builder to make a query and linked it to the stock table with no success.

I would be grateful for any ideas, I am sure it is relatively simple

View 3 Replies View Related

Calculating Finances

Jun 15, 2005

Hi Guys,

New to the forum, and its nice to see how active this place is, and upto date.

My question is, and probably simple to correct. ( Please be patient with me, i`m new to this, and my terminology might be incorrect, also please simple answers )
I`ve searched the forums, but as my teminology is wrong I cant find the results im after :)


Anyway, I have a table with many fields in it, but the parts i`m having problems with are as follows.
I have fields with
Price Inc Vat, Deposit Payment, Stage Payment, Balance Payment & Balance Due.,

The part im trying to get to work is the balance due which I want to automatically update, based in the data inputed into price inc vat deposit payment etc.

The calculation i`m after is as followes
Balance Due = ( Total Ammount Inc Vat - Depost Payment - Stage Payment - Balance Payment )
eg, Total Ammount Inc VAt = £2000
Depost paid is £1000
so far balance due would be £1000
Then Final Payment is made 2 weeks later £1000
So balance due would then show £0.00

Is this possible

Thanks in advance

If I have not made myself too clear, please excuse my crapness, and anyhelp Is much appreciated.
If you need any more info, please do not hesitate to contact me on
max.vernon@claddagh-group.com

Thanks in Advance

Max Vernon

[edit]

Just to let you know, I also need these details kept in the table for future reference so I dont think I can use a query to do it.
I`ve attached a copy of the database with some example data in it if this is needed for any assistance.

View 8 Replies View Related

Calculating Date

Jul 17, 2006

I'm suppose to create a list of 20 clients and let 5 accounts be 90 days past due, 5 over 60 days, 5 over 30 days three of each of the accounts have a balance over $75. Then it asks me to create a total of all account balances so that the total amount of recievables can be known. The second part is calculate the number of days each balance has been outstanding.My question is this can you calculate dates in a table or can you only calculate in a query. I'm new at access so have patience with my question(s)

View 3 Replies View Related

Calculating New Field

Feb 26, 2008

Hi I'm building database for a car shop. One of my table (Cars) has these two fields in it intModelPrice (which stores factory price of a model) and intPriceWithTax (which value should mathematicaly be intModelPrice+[(intModelPrice)*(18/100)]).

Now, can I set my default value of intPriceWithTax to be calculated by this formula and how? I tried some combinations but I got various error messages.

I red Tips section on your site and saw that default value can't be calculated. I know how to get what I want in the select query but I want this table field (intPriceWithTaxt) to be acctualy filled with number value each time I enter a new record in this table (for a new car model). How do I acomplish this? Thanx.

P.S. - I searched the forum for answer but I had no luck.

View 11 Replies View Related

Calculating Quarters

Jul 19, 2005

Hello All!

I have data laid out as follows:

Measure MonthYr Value
Fixed Std Jan04 90%
Fixed Std Feb04 95%
-------- ------ ----
-------- ------ ----
Fixed Std Jun05 93%

My situation is two-fold: 1-I'm having difficulty coming up with a query that will calculate the weighted avg. of each quarter in the prior year and current year, 2-what to do about the current year's quarter when only 1 or 2 month's worth of data exists?

Can anyone help - it would be greatly appreciated. Thanks.

View 3 Replies View Related

Calculating Percents

Sep 22, 2005

I have a table containing the following fields :
Sex(text), Age(numeric), sodium concentration(numeric).

I am trying to write a query which will return the percentage of male patients have a sodium concentration of a certain range (ex:120-130) out of the TOTAL number of patients.
I am able to count the number of events which fit the criteria but I cannot figure out a way to calculate the percentage part (unless i manually add a field in which I devide the count result by total number of patients).

Any ideas?
Thanks

View 4 Replies View Related

Calculating Across Tables

Oct 19, 2005

Hey Guys,

It’s been a while but I have been visiting from time to time. Just been busy with a load of web design.

Anyhoo, I have been asked to create a report on total revenue generation for projects and have taken it as far as I can, and now need your help.

I have two queries “qryCommTrialsRevenue_PatientEvents” and “qryCommTrialsRevenue_StudyCharges” that select income via two cost codes and between two dates.

Two further separate queries calculate the total for each project. That’s as far as I can take it at the moment and now I cannot see the wood for the trees…I need to calculate the total for each project ACROSS the tables. Can this be done successfully? Every time I try it the numbers don’t add up.

Cheers,

Rusty
:D

View 2 Replies View Related

I Need A Help When It Comes To Calculating Commission

Nov 16, 2005

I have a question I need help for, below is a very strict detailed explination of the current scenario I am in and I need assistance for it:

1) I have a percentage of Commission I need to calculate, the percentage of commission constitudes of the following information:

a) Date,
b) Customer Name,
c) Company,
d) Name,
e) 5% New,
f) 3% Ext,
g) Rep,
h) Doble Ref (0.025, 0.015),
i) Total Amount, and
j) Total of Commission.

If a person enters the same customer name more than ones, it will give that person's name a Doble ref (0.015) of commission, if on the other hand that customer is new it will give that person a commision of 0.05% new. I hope this is not intending to confuse you, it just gives the general idea of what the percentage of commission is intended to be.

To come back to the point, I have a form created under Access that holds all the names of the person's reference by in that case "Name" letter (d) described above. If I select for example a person name "Fahed" and I click on the button calculate new commission I want to be able to draw all the commissions that Fahed have done and then use the form above to do the approriate calculation.

The above is a general problem, below is the scenario:

I get a form called New Client, the form New Client is a parent form and underneath that form is a sub form which holds estimates, invoices and so on. Ones again I am giving you the picture of what the form looks like, I cannot paste the pictures here because they would take time and would not be clear. The new Client has a text field called Reference By. That text field is where I need to get for the Percentage of Commission form to be entered under the field Name, letter D (described above). The total of amount is extracted from the subform Invoice, total, of the parent form called New Client, and there is a check mark in the new client called "Already existed" that if I click it, that information is then send on a separate form called "PercentageOfCommission" that will determine if it calculates the percentag of 0.05 or 0.025 depending if it is Calculate Commission or calculate existing commission.

I want it to be able then to do the needed calculation which I already have the approriate formula for and then display in a report what is shown above.

I don't know how to get information from different forms, and I don't know how to display for example ALL FAHEDS with information but are related only to FAHED.

Ones again, let me give you an example:
Date Name Info
15-Feb 05 Fahed Stonyx
15-Mar 05 Fahed Commodore
...
18-Sep 05 Ahmed Apple IIc

I want to display only one name Fahed and when I click for example display summary to show ALLLL the name that holds Fahed that have different Info. Any help would be greatly appreciate it.

If you feel what is posted here is TOO confusing and trying to explain it on the messageboard might take time and you wish to assist a poor soul in need, then you can contact me at devastating_battle@hotmail.com so we can talk live in MSN to be able to describe the matter much clearly. Please don't ignore me and leave me hanging in the air dry, thanks in advance.

View 1 Replies View Related

Calculating Text Box

Feb 6, 2006

hi all,

i need your help on how to calculate non-value item, in this case a textbox fills with course names & description. please refer to attachment for more information.

thanks

View 2 Replies View Related

Calculating Dates

Feb 23, 2006

I have a table "main" with 2 colums (main_id,date_out). This table has a link to the table "refill". This table has 3 colums (refill_id, main_id, refill_date).
Example data:
TABLE MAIN
main_id - data_out
01 - 01/01/2006

TABLE REFILL
refill_id - main_id - refill_date
01 - 01 - 10/01/2006
02 - 01 - 16/01/2006
03 - 01 - 21/01/2006

When I make a simple selectquery with the fields main.date_out and refill.refill_date I become the the next result.
01/01/2006 - 10/01/2006
01/01/2006 - 16/01/2006
01/01/2006 - 21/01/2006

Now the problem.
I have to calculate the days between the main and refill dates
01/01/2006 - 10/01/2006 ( is the same as above)
10/01/2006 - 16/01/2006
16/01/2006 - 21/01/2006

suggestions????......thanks

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved