I have an MS Access DB in which I have a history of call data.
I would like to update a column which indicates, if this is a call from somebody, who tried to contact us already a specific time ago, let's say 180 minutes ago.
The column in which the number of the caller is, is called "caller" and column in which the arrival time of the call stands is labeld as "Call_Start"
In Excel I found a solution, however I have no clue how to transponse this solution into access.
Thank you for your feedback!
markus
To get the difference in minutes you would use a calculated field in a query something like;
TimeDiff: DateDiff("n",[Call_Start],Now())
The full syntax for DateDiff is here https://support.office.com/en-gb/article/datediff-function-e6dd7ee6-3d01-4531-905c-e24fc238f85f
Related
I am trying to get a date difference to determine cycle time of when something arrives to completion. However, I need the product to count towards cycle time average for all days it is here. So, something along the lines if arrivdate='8/16' but completiondate='8/24', I need for the cycle time for this product to be 1 on '8/17', 2 on '8/18', etc until it is 8 on '8/24' and then stops counting. I am willing to do it in either Excel or SQL, if there is a fast way to do it. Below is an example of the data in an Excel sheet
https://drive.google.com/open?id=0B4xYGwf8uS7ZdE5YRDYzXzNuOTQ is a link to the file, as I'm not sure how to insert a table in here.
Does this suit?
If I understand your question properly this simple formula should work. You can replace the 0 with "" to leave it blank
I am trying to create a report that displays 3 different numbers for each of my projects.
Contract Hours - Stored in projects table, 1 to 1 relationship
Worked Hours - Stored in linked table that will be updated using an external website reporting feature that will contain only data for the dates that are to be displayed in the report, one to many relationship needs to be a sum
Allocated Hours - Stored in a table in my database called allocations and contains data for all dates, one to many relationship needs to be summed.
Right now i have it set up in a way that the user has to type the data range for the report every time it is run, however the date range only actually applies to the Allocation data because the worked hours data comes filtered and the contract data is one to one.
What I would like to do is set up a query that can see the domain of the worked hours and apply it as a date criteria for the allocated hours.
I have attempted to use max and min values of the Worked hours and tried to get creative but I'm actually not even sure if this is possible because I cannot see any simple solution (although I know it should be possible and fairly simple)
Any help, suggestions, or recommendations are appreciated.
I have a view that lists employee (EmpID), request number (ReqNo), date request was opened (OpenDate) and the date it was moved to the next step in the process (AssignDate). What I am trying to do is get an average of the daily queue size. If EmpID 001 has 20 requests on 1/1/13, then has 24 on 1/2/13, 21 on 1/3/13 the average over 3 days should be 21.66, rounded up to 22. I have the following view:
CREATE VIEW EmpReqs
AS
SELECT [EmpID], [OpenDate], [AssignDate], [ReqID]
FROM [Metrics].[dbo].[Assignments]
WHERE OpenDate BETWEEN '01/01/2013' AND '12/31/2013' AND
[EmpID] IS NOT NULL AND
[ReqNo] NOT LIKE 'M%'
I then wrote a query to pull individual employee's queues per day:
/* First attempt to generate daily queue #s */
SELECT * FROM BLReqs
WHERE [BusLiaison] LIKE 'PN' AND
[OpenDate] <= '11/15/2013' AND
[AssignDate] > '11/15/2013'
Because no one has attempted to pull this information before, I have no way of verifying how accurate the above is. I tried using current dates, since I can see those in our database to compare but the code doesn't work, nothing is returned when I change the dates to 2014 and run my query.
What is the easiest way to verify that my code is correct, short of manually counting a day's queue?
Can anyone see any issues with the above scripts?
Is there a way to get the above code to work with current dates?
This question is really hard to answer because it is kind of broad and has little information at the same time. I'll try anyway:
Because no one has attempted to pull this information before, I have
no way of verifying how accurate the above is.
Try checking the result of this query for a few sampled dates.
I tried using current dates, since I can see those in our database to
compare but the code doesn't work, nothing is returned when I change
the dates to 2014 and run my query.
So clearly, the query is not working. You should probably find out why. Run the query for a date of which you know that it should return results but doesn't. Remove conditions one by one to see which one is incorrectly removing all rows. This should be enough to identify the bug.
Can anyone see any issues with the above scripts?
No, looks fine. A very simple query. That's why I said that we have too little information. There is some key piece of information missing that allows us to find the bug.
Is there a way to get the above code to work with current dates?
Stop staring at the code and hoping for a revelation. Debug it. Experiment.
List item
Hi I am trying to count the number of times an event is raised within the last 14 days of a date. simply put if i have an opened case on the 23rd of last month i want to check the previous 14 days of the 23rd to see if there have been another event raised of the same type within that period.
Is there a reason you can't do this in the SQL, and need to have it within the RDL?
The SQL should be easy, try making use of subqueries to get around the aggregate-of-an-aggregate hurdle.
If you need to do it within the RDL, the Lookup() and LookupSet() functions might make your life easier.
If this doesn't help you, could you post a bit more detail? Data structure may help.
I like to think i'm not completely useless at creating MS Access databases, but i'm definitely a failure at the SQL code side.. So as a result i'm not sure whether this is a stupid question or not!
At work i'm trying to add a "news feed" type thing to a Form on the front screen of a database used to find useful information stored in various places. At the moment my workplace is using Office 2007, but Access is the 97 version!!!! As they're only recently realizing it can be used to solve a few of their problems... we're expecting to upgrade the whole of office and access to 2010 soon.
On this database (created using access 97..) there is a "refresh" type button which simply closes and re-opens the form and thus shows the latest info entered onto the "news feed", and this also shows the current time and date. What i'd like to happen is have specific entries drop off after a period of time (which probably wont happen unless refreshed), so for example an entry will have been added regarding some server ammendments being made within the workplace so "certain systems will not be working between 8am and 5pm GMT on 9/1/12" and preferably the person who created this entry could enter a date into the form 24 hours, or even a few days, later and when this date is reached the entry would disappear. I understand this is something that may be achieved using a query but i have no idea where to start.
If anyone can help give me an idea of how to do this it would be greatly appreciated.
I apologise if this is poorly worded or not completely clear, i can elaborate if questions are asked.
many thanks,
Kris
You can make a query like this to return only the entries that are less than 3 days old:
SELECT *
FROM MyTable
WHERE CreateTime > DateAdd("d", -3, Now())
In your form, you can define a timer interval and a timer event handler (see the "Event" tab on the properties window). You could use it to requery your list (Me!lstNews.Requery).
In the table you can define the column "CreateTime" as data type "Date/Time" and define its default value as =Now(). This way no text box is required to enter this data.
EDIT:
How to configure the timer in an Access Form (time is in milliseconds):