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 Replies
ADVERTISEMENT
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
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 1 Replies
View Related
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'> </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> </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> </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'> 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'> This</font></td></tr><tr><td width='200' height='20'> </td><td width='400' height='20'> </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'> This</font></td></tr><tr><td width='200' height='20'> </td><td width='400' height='20'> </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'> This</font></td></tr><tr><td width='200' height='20'> </td><td width='400' height='20'> </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'> 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'> 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> </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> </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'>" & _
" 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> +44 (0) 208 814 2727</b></font></td></tr></table></td>" & _
"</tr><tr><td> </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> </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);'>" & _
" 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);'> +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);'>" & _
" +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'> 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'> 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
Oct 23, 2012
I have a project with several activities, each activity has specific people who work in the activity and of course an ID for the activity. Now every person has a unique ID, name, address, birth date, address ,,,, etc
a person can work in several activities ,, now what i want to know is should i put activities in a table , and persons in another table or what !!? how can i connect the two tables? How can assign a new activity for the persons?
let us say that all the activities need 100 workers, but there will be duplicate of the workers, how can i find the actual number of the workers without duplicate?? ( i need to find the numbers of all workers and the number of the actual workers)
Finally i want a restriction that if a person worked in five activities, i want an alarm or warning that this person has worked for four activities and he can't work any more, is that something i can do !??
View 5 Replies
View Related
Jan 15, 2015
I have created a table for a Gym that shows which classes / activities are on which days. You will notice in the image below that i have assigned Boolean to associate a class with a day of the week.
I now am trying to create a Calendar STyle report that GROUPS all activities by the day they are on. So, for example, see below:
As you can see, all of Monday's activities will appear first (in a group) followed by Tuesdays.
One way I think I could achieve this is by doing a QueryMonday, QueryTuesday...etc so I have dataset or resultsset for each day. Then I could bring into a report, each query as a sub-report. I believe this is overly complex for what i'm trying to achieve. Also, using 5 grouping levels in one report doesn't achieve it either.
View 2 Replies
View Related
Feb 25, 2014
I have a report that shows the daily activities. it shows how long it takes to do each task. however some tasks are 8 hours andsome are 10 hours. when all these times are added together it will give the time on a clock. not a total of hours spent.
i.e.
treatment1 : 8 hours
treatment2: 10 hours
this will give 06:00 in short time. in medium time it will give 18:00.
however if I add another 12 hours to that it will give 06:00.
I want it to show either 1 day and 4 hours /or 30 hours.
View 7 Replies
View Related
Jun 5, 2013
Query of daily activities spent hours
1) to be group as weekly total
2) then need to transpose it for reporting.
My table fields are Date, SpentHrs and Code (activity code description).
View 11 Replies
View Related
Aug 1, 2014
I have been working on a simple data base for some time now (beginner level) and am still trying to improve it. I would like to do something but before that I would like to have your opinion to know if it is even possible?I have a query QryMainReport:
Start Date/Time
End Date/Time
Employee
At the moment this is what the format of my report looks like (I removed other unnecessary fields):
StartTime----------EndTime---------------Employee
12/06/2014 01:00--12/06/2014 03:00------John Smith
12/06/2014 04:00--12/06/2014 06:00------Jane Doe
13/06/2014 02:00--13/06/2014 05:00------John Smith
13/06/2014 08:00--13/06/2014 08:00------Jane Doe
I would like to do as a report. (Dates would always be from Sunday to Saturday). I am not sure it is possible to do that. I suppose first it would mean:I would have to do a query to separate the times from the dates?I would have to find a way for Access to find the unique dates and unique names?Does it mean I have to use cross tab queries?
View 2 Replies
View Related
May 23, 2005
A customer's name is SZEE. Seek him through the SName textbox with Find, and Access can't find him. (Same in the table.) Seek him with a wildcard Sz* and there he is.
I've tried it on another machine - also with Access2k - and it's the same.
Is it an Access quirk? Is there an answer? (The client asks why. Be good to be able to say.) Cheers.
View 3 Replies
View Related
Aug 10, 2006
Is there any way I can do a search that lets me put in a section of a part number and the part number be found? I only see how I can find the number if I put in the entire number.
Thanks
View 4 Replies
View Related
Apr 25, 2006
I think this is fairly simple, but being as I haven't ever done it! I want to do a search to find all records less those called "Default". As I say I just cant think how to do it. Any help appreciated. Thanks
View 2 Replies
View Related
Apr 6, 2005
Hey everyone,
Im creating a database for college using MS access 2003.
I have 3 table that contain data and i am building form to allow a user to search for a particular customer. The customer ID in my customer table is an auto number.
I have a button on my form and it shows the find and replace box when pressed which is what i want but i then want it so that when a user types a customer ID number in to that find and replace box and it is an exact match for the find and replace box to auto close else show an Error message and allow the user to input another customer number,
Im sure there is macro code to do this so im asking if anyone knows or has any better ideas?
Thanks for your time
View 2 Replies
View Related
Sep 19, 2004
Hello Expert,
I have attempted for two days to following codes. I am still unable to get the way out. Would you give me a help?
The field fund_cd is a combo box of transaction table to look up reference table called fund_type. Here is the structure of fund_type:
fund_cd text 3
fund_desc text 50
fund_currency text 5
My needs are to pull both values of fund_cd and fund_currency to transaction table, so 1 combo box cannot meet my needs. As such, I write following codes to base on selected fund_cd to find appropriate value of fund_currency in fund_type.
From the code below, I meet the run-time error ‘3001’ and I am not sure can I finally get fund_currency using method of GetString.
Dim strSQL As String
Dim strccy As String
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenStatic
rst.Open "Select * from fund_type"
strSQL = "fund_cd = " & Me.fund_cd
rst.MoveFirst
rst.Find strSQL, 0, adSearchForward
strccy = rst.GetString(adClipString)
Thanks very much!
martinaccess
View 1 Replies
View Related
Dec 24, 2004
I am trying to code a combo box control to find a record. This is incredibly simple but for some reason it won't work. Could you tell me what I am missing.
I have put the following code in the after update of the control
Dim rs as Object
Set rs= Me.Recordset.Clone
rs.FindFirst "[ContestNo]='"&Me![Combo23] & "'"
Me.Bookmark=rs.Bookmark
I don't get any errors but it won't work either...any ideas??
thanks in advance,
Brenda
View 2 Replies
View Related
Feb 1, 2005
I have an unbound text box. I want the user to
be able to type in all or part of a title for a movie.
Hit the find button and then have a form open
with entry's based on the text box.
Thanks Tukewa
View 2 Replies
View Related
Aug 17, 2005
Hello to all,
Little new in Access i would like to know how to use the key to find directly to a record in a table.
ie : i have a table where the primary key (unique) is a date, using VBA i would like to know the instruction to find directly the record 01/06/2004 for exemple.
Thanks in advance.
VINCENT
View 2 Replies
View Related
Sep 27, 2005
I realize this probably isn't the right place for this, but...how do I find all of my posts, whether I started a new post or responded to someone else's post?
Thanks in advance to whoever replies :D
View 2 Replies
View Related
Mar 7, 2006
I have a find command button that appears to call the find and replace message box. It should be a search for anything in my query. The code behind the button looks like the find and replace message box in the office suite. I believe I am trying to create a message box where you add an entry and it searches then lauches a subform with my entries.
When I checked the button it had the following code:
Private Sub cmdFind_Click()
On Error GoTo Err_cmdFind_Click
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_cmdFind_Click:
Exit Sub
Err_cmdFind_Click:
MsgBox Err.Description
Resume Exit_cmdFind_Click
End Sub
I read a few of the lookup queries but they only give me a drop down. Is there some way to customize the box comes up without altering all of Office or do I just sound lost.
View 1 Replies
View Related
Jun 1, 2006
Ok, so I made a registration website with FrontPage and published it. The registration page has several text boxes and a submit button. I was testing it out and entered a few dummy names. The conformation page popped up and said everything was ok. So I'm assuming the data successfully uploaded into the Access DB that I linked it to while in development.
My problem is when I go to the folder where the DB resides there so no data in the tables. I'm thinking that maybe when the website gets published a copy of the DB is moved somewhere and I'm looking in the wrong place? This is the first time I have made a webpage or used FrontPage so please excuse my ignorance, hehe.
View 1 Replies
View Related
Jun 1, 2006
Ok, so I made a registration website with FrontPage and published it. The registration page has several text boxes and a submit button. I was testing it out and entered a few dummy names. The conformation page popped up and said everything was ok. So I'm assuming the data successfully uploaded into the access DB that I linked it to while in development.
My problem is when I go to the folder where the DB resides there so no data in the tables. I'm thinking that maybe when the website gets published a copy of the DB is moved somewhere and I'm looking in the wrong place? This is the first time I have made a webpage or used FrontPage so please excuse my ignorance, hehe.
View 1 Replies
View Related
Jan 24, 2007
Hi all
This message has suddenly started to appear when clicking on a shortcut to all my mdbs.
Windows cannot find [path] .mdb
I click OK and the db continues normally.
the message does not appear when opening a mdb directly.
odd huh?
any thoughts on how to resolve this annoying problem would be appreciated
View 1 Replies
View Related
Jun 21, 2007
Hi, I am inputing addresses into a massive databse, through a form, does anyone know a way, that i can get it to do a search for the address based on the postcode, like how googlemaps does it or something?
Thanks
Alex
View 2 Replies
View Related
Aug 21, 2007
I have some database, I need to replace empty cells one column with some data.
But Access does not do it.
Any suggestions?
View 1 Replies
View Related
Jan 14, 2008
I need to add a Form to an Access database designed by others. In the form design view, there is no toolbox shown . If I go to View menu, toolbox is greyed out.
Can anyone please advise how to locate the toolbox?
View 2 Replies
View Related
Jan 18, 2008
Hi,
I have a database created in Access 2000. It works OK on computer number one. When I copy the data base to another computer and open it, the table can not be found. The error message is "D:DocsdgrDocent Library Nov 2005 is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which it resides" The path mentioned is the original path on computer number one. The DB opens but it will not find the table or the queries etc. I thought that moving the DB had something to do with it but when I copied the DB to an external HD and then opened it, it works fine. But when I connect the external HD to the other computer it doesn't find the table.
Both computers have Access 2000.
Number one is XP and number two is W2000.
David G Rhoades
dgrjazz@sbcglobal.net
Thanks:)
View 2 Replies
View Related