Modules & VBA :: Converting Dates Into Downtime With Automatic Calculation

Jul 20, 2015

Currently I have a form with these variables

- Assets
- Shifts
- Machine Offline Date
- Machine Offline Time
- Machine Online Date
- Machine Online Time

Now I have 82 assets in the factory and 20% of those machines run 3 shifts. Each shift is 8 hrs.What I have already done is allocate shifts per asset e.g. when I pick Asset (a) in the Asset combo box, in the shift box it will automatically generate 2 or 3 dependant on what I have set.

If an asset runs for 2 shifts, it would mean that, that asset is operational/running from 0700 - 2300 or 7:00am - 11:PM also if an asset runs for 3 shifts it would mean that, that asset is operational/running from 0700 - 0700 or 7:00AM - 7:00AM

Scenario A: Machine (a) breaks down at 1700/5:00PM on the 10/7/15 and was back online at 12:30 on 11/7/15, This machine runs for 3 shifts which would mean in the "Breakdown Downtime" the result should be 19.5 hrs

Scenario B: Machine (b) breaks down at 1900/7:00PM on the 10/7/15 and was back online at 10:00AM on 12/7/15, this machine runs for 2 shifts which would mean in the "Breakdown Downtime" the result would be 23 hrs.

I would like to make this an automatic calculation, Is this possible?

View Replies


ADVERTISEMENT

Modules & VBA :: Converting Dates Into Week Numbers

Oct 2, 2013

I am trying to write some VBA to convert a date into a week number.

My work colleagues do not not what system is used to define the week numbers. So I have gone through all their records for a few years and deciphered this pattern:

I need the code to define that there are 52 weeks in a year. The last sunday of Dec is the beginning of Week 1 for the following year. Except when it is a leap year where Week 53 exists. otherwise it only goes up to week 52.

Start day for the week is Sunday. End day is the Saturday.

Some examples to check against:

22nd December 2013 = Week 52 2013

29th December 2013 = Week 1 for 2014
----

21st December 2014 = Week 52 for 2014

28th December 2014 = Week 1 for 2015
----

20th December 2015 = Week 52 for 2015

27th December 2015 = Week 1 for 2016
----

25th December 2016 = Week 53 for 2016

1st Jan 2017 = Week 1 for 2017
-----

Tried various methods already

iso 8601, wrong week start day

intWeek = DatePart("ww", datDate, vbSunday, vbFirstFourDays) Was right for 2013 but wrong for later dates.

View 14 Replies View Related

Automatic Calculation In Table

Jun 27, 2006

I am new to Access. Is there a way to do a automatic calculation in a table field?

eg fieldA divided by fieldB and have the result show up in fieldC

Thanks

View 7 Replies View Related

Access 07 -- Automatic Calculation Of Difference

Aug 7, 2007

Hi, I am creating a table in 07 and I want my table to be able to calculate the difference between two amounts. I have the column "price" which shows the total amount, another one called "money paid" which shows how much of the total amount they have paid so far and the third is "money owed" which is the difference that i want to be calculated automatically.
Do you know any way to do this??

View 5 Replies View Related

Converting An Age Calculation To Years And Months

Jul 22, 2005

i am calculating an age from (Birthdate - date())/365.25 and this works fine except it gives me a value which has a decimal place (ie 6.7 years old). How can i convert it to 6 years and so many months?

View 5 Replies View Related

General :: Automatic Calculation Of Date Differences

Sep 13, 2012

The project I'm working on is an action list with the following tables;

itemnumber - autonumber PK
originator - text
dateentered - date/time
actiondescription - text
assignedto - text
targetdate - date/time
forecastdate - date/time
actual date - date/time
remarks - text
due - text (not sure if this will be correct)

Basically, when a new task is entered, all info will be manually filled in except last 3 fields. targetdate needs to be locked after entry, and forecastdate initially set to targetdate.

"due" should show how many days between dateentered and forecast date, and preferably update everytime the DB is opened. IF the current date is beyond the forecast date, "due" should read "OVERDUE".

Changing forecastdate would obviously reset the "due" field to show how many days left to complete. If a date is entered into actualdate, then "due" should show COMPLETE.

Reports will be generated based on what is coming due, what is over due, and not show what is already complete.

View 4 Replies View Related

Automatic Dates

Dec 4, 2006

I am building an employee performance report database. Part of this report I need to integrate initial and midterm feedback dates. These dates are as such:

The initial is 30 days after supervision started or annual performance report completed
The midterm is 120 after supervision started or annual performance report completed

I'd like to give the supervisor a set month for their feedback completions as a guidline. If they are a few days prior or after the "30 day or 120 day mark" it is not a big deal, so I am just wanting it to automatically calculate the month rather than a specific day. After a performance report is completed the intial and midterm feilds should automatically update to calculate the new feedback dates for the next year.

The most updated dates need to be available for supervisors to print on a master report on all their subordinates. No need to store older dates (unless the performance report has not been completed yet)

Pertinent Info:

Form: Perf_Report
Table: Rater_tbl
Field Name 1: Initial ::: (format = mmmm)
Field Name 2: Midterm ::: (format = mmmm)
Field Name 3: Date of Supervision ::: (format = dd mmm yyyy)
Field Name 4: Report Completion ::: (format = dd mmm yyyy)

View 1 Replies View Related

Queries :: Automatic Dates In Query

Jun 12, 2015

I have a table with tasks in which are allocated to specific staff members. The start date of the task is currently inputted by the user and then an estimated time frame is inputted which automatically enters the planned end date.

When a task is complete a Yes/No box is ticked so that these tasks don't show up on the current list anymore.

I wondered if it is possible, for the second task allocated to a certain person to have the start date automatically inputted depending on the planned end date of the precious task.

So if the planned end date was 12/06/2015 then the start date of the next would be 12/06/2015 and so on.

View 2 Replies View Related

Converting Unix Dates In Access

May 4, 2004

hi all,

i'm importaing a table through a mysqlserver, it contains a field (call_time)
and its a long integer, i suppose it's an unix date format that can be converted

into DD:MM:YYYY HH:MM format, only problem is i cant find a way to do it on access
i've tried creating a query with all the fields and adding my one fields with commands such
as valdate([call_time]) but it dosen't seem to work.

can anyone help me please

Thank you

View 3 Replies View Related

Converting Dates Into Text From Combo Box

Dec 17, 2004

Dear All:

I have creadted a form with a combo box that has 3 dates in it: February 1, 2005, September 1, 2004 and June 4, 2004.

Is there a way to display in another field on the form(A text field) when one of these dates is selected from the combo box, a text field returns "DATED ON THIS FIRST DAY OF FEBRUARY TWO THOUSAND FIVE"?

I reckon this is a vb issue and any help is appreciated.

Thanking in advance

Dion

View 2 Replies View Related

General :: Converting Strings To Dates?

Sep 18, 2014

I am trying to manipulate some Ebay data, which returns a string like "1d 00h 29m"

Is there a function I can use to convert this string to relevant hours in total?

View 14 Replies View Related

Converting Text Dates To Integer With Nulls Present?

Mar 18, 2013

I have a text field like, 11242010, and I need to be able to convert it into 3 int fields, day, month, year. I am trying to do this in a query and have create the following three;

DateD: IIf([DATE] Is Not Null,(CInt(Left(Right([DATE],6),2))))
DateM: IIf([DATE] Is Not Null,(CInt(Left([DATE],2))))
DateY: IIf([DATE] Is Not Null,(CInt(Right([DATE],4))))
Time: IIf([TIME] Is Not Null,[TIME])

When I have a value of Null, i keep getting #Error, I think when it's null.

View 7 Replies View Related

Converting Yyyymmdd Dates To Serial Date Number

Sep 5, 2011

I have two tables that I want to append to each other.But in one of them the date column has the yyyymmdd format and in the other it is a serial date number.How can I make them consistent by either converting yyyymmdd to date number or by converting the date number to yyyymmdd?

View 1 Replies View Related

Queries :: Converting Mmmm Yyyy To Including All Dates In That Range In Query

Oct 14, 2014

My table has many records for each month. I am creating a report that will display only the records in one month of a year. I have been able to create a form that gives the user the choice of the Month and Year for which to create the report. The code I am using to create the combo box is:

Code:
SELECT DISTINCT Month([QTDate]) AS MoNum, Format([QTDate],"mmmm yyyy") AS MoName
FROM MainTBL
ORDER BY Month([QTDate]);

What I need to do now is create the query for the report that displays all records for the chosen month and year. If I simply reference the combo box, all it shows is mmmm yyyy and the days are missing so the query doesn't work. What do I need to do to create the query so it displays all days within the month and date selected?

View 6 Replies View Related

Calculation Workdays Between 3 Dates

Oct 10, 2006

I have a table with 3 columns

Order Date (f.e. 05/10/2006)
Due Date (f.e. 09/10/2006)
Ship Date (f.e. 10/10/2006)

I would like to calculate:

number of working days between order date and due date
number of working days between due date and ship date

Can someone help me with this one?:confused:

View 6 Replies View Related

Problem With Calculation From Dates

Dec 9, 2005

I have a form with two date fields: "Initiation_date", and "Correction_date". There is a third field called "Duration". I would like to store the values of all three fields in the corresponding table. "Duration" (Long Integer) would be the number of days from "Initiation_Date" to "Correction_Date" if Correction date is there, or to Date() if Correction date is Null.

I can use an unbound text box to get "Duration_cal" using the following as a control source:

=IIf(IsNull([VCor_date]),DateDiff("d",[VInit_date],Date()),DateDiff("d",[VInit_date],[VCor_date]))

But I cannot get that value (No.of Days) in to the "Duration" field. The reason I want to have "Duration" stored as a number is that it is being used in a query for another calculation (total days used for selected records).

Is there a simple way to accomplish this?

Thanks

View 2 Replies View Related

Queries :: Adding New Field For Calculation Of Dates?

Oct 10, 2013

I am working on updating another person access database, how to add a calculated field. I need to add a field to an existing table to subtract the date listed in one field from todays' date. It would need to return the answers in days

ie

10/10/13 - 10/1/13 = Return answer of 9 days

I have been told about DateAdd but I cant find these date function in the option of expression builder.

View 3 Replies View Related

Modules & VBA :: Automatic Data Export To XML

Sep 22, 2014

I have back-end on LINUX, is there any possibilities to automatic export data to *xml? e.g. every 5 min. Maybe some code in vba which can be connected to system timer?

View 3 Replies View Related

Modules & VBA :: Automatic Expanding List

Sep 2, 2013

I'm making an accounts package, the user creates job reports every time they complete a job. The user then creates an invoice which contains the information from a job report.Any one invoice can contain information from multiple job reports.There is a field called J_InvoiceNumber in the job reports table and field called I_InvoiceNumber in the Invoices table. A particular job report is linked to a invoice by using the same number in J_InvoiceNumber as was in I_InvoiceNumber. let me give you an example:

JobReport1, JobReport2 and Jobreport3 all have "1" in their J_InvoiceNumber Field
Jobreport4 has "2" in it's J_InvoiceNumber field.

so now Invoice1 which has "1" in it's I_InvoiceNumber field has 3 job reports and Invoice2 which has "2" in it's I_InvoiceNumber field has 1 job report.This works for presenting the information for each invoice in a Access Report but now I'm trying to make a table view just to see all the invoices and job reports in a big list.

The problem is that using a query presents me with the same information duplicated. So in the example the query would display I_InvoiceNumber as "1" for jobreport1 then a new record showing I_InvoiceNumber as "1" for jobreport2 and then another new record for jobreport3 again showing I_InvoiceNumber as "1".

What I want is for I_InvoiceNumber to be displayed once and then prehaps a expanding tree showing all the job reports sharing this number in their J_InvoiceNumber field.

View 2 Replies View Related

Modules & VBA :: Converting String To Variables?

Jan 30, 2015

I am trying to set up some template emails using text someone has entered in a form with a variable indicated with a key word in brackets aka. [ChangeID] or [ChangeDate]. The field on the form is formatted as Rich Text so I am getting http code. (No problems yet) In the form the template is required, I lookup the template required and I get the string. I replace the brackets with the following

Code:
strleftB = Chr(34) & " & me."
strRightB = " & " & Chr(34)
strTemplate = Replace(strTemplate, "[", strleftB)

I then get a string but in need to convert part of the string into variables, before I capture the correct output for my email

Code:
"<div>RFC Submission: <strong>" & me.ChangeID & ", </strong> " & me.Details & "</div>"

My question is: what is the best way to split the string into strings and variables

View 7 Replies View Related

Modules & VBA :: Converting Text To Numbers

Sep 19, 2014

I have a short text field where numbers such as "15.00", "2233.56", "-300.00" are stored. Now I want to convert the text field to numeric so that I have actually 15.00 or -300.00 stored as a double. I am going to do calculations on these fields. How can I achieve this conversion?

View 4 Replies View Related

Modules & VBA :: Converting SQL Statement To DLookup

Jun 27, 2013

I have the following SQL Statement which returns the desired result to me

Code:

SELECT tbl_p_stats.i_closing
FROM tbl_p_stats
WHERE (((tbl_p_stats.i_weekending)=[forms]![frm_a]![i_olddate]) AND ((tbl_p_stats.i_sacat)=[forms]![frm_a]![wfid1]) AND ((tbl_p_stats.i_complexity)=[forms]![frm_a]![wfc1]));

And am now trying to convert it to a Dlookup to provide the default value to a control on form Loading. The statement i came up with is

Code:

= DLookup("[i_closing]", "tbl_p_stats", "[i_weekending] = " & i_olddate & " AND [i_sacat] = " & wfid1 & " AND [i_complexity] = " & wfc1)

However, it is showing the control (wf1oi) as a blank control now. When I run the dlookup through the immediate window, the returned result is Null.

A little more detail
- All the mentioned controls live on the same form (frm_a)
- The control that this Dlookup is going into is called wf1oi

View 10 Replies View Related

Modules & VBA :: Automatic Mail To Be Triggered From Access

Mar 11, 2015

I have a table in Access with a field End Date with couple of other fields like Company Name and Description associated with the End Date as one record. In other words, one record has fields Company Name, Description and End Date.how could I get Access trigger an email automatically to a set of people let's say a month before the End Date is approaching. If the End Date is 30/4/2015, I would need Access to be triggering an email to the recipients on 30/3/2015.

View 3 Replies View Related

Modules & VBA :: CDate - Converting String Into Date

Nov 12, 2013

I would like to convert 2013.11.13 which is a string into a date. This is what i have so far but it's not working.

2013 year

11 month
13 day of week
Dim strDate As String, dteConvertedDate As Date
strDate = 2013.11.13
dteConvertedDate = CDate(Mid$(strDate, 6, 2) & "/" & Left$(strDate, 4) & "/" & Right$(strDate, 8))
MsgBox (dteConvertedDate)
End Sub

View 7 Replies View Related

Modules & VBA :: Automatic Database Table / Fields / Records Count

Apr 9, 2014

the project I have comprises four seperate databases all linked but kept apart for logic and data reasons. I must have rapidly approaching 300k records across all of them. As a result I am trying to extract on a regular basis (monthly) the dimensions of each database. Specifically, I want to be able to produce for each database;The number of tables (I have two types data and reference, it would be nice to be able to split the result).The number of fields per table.The number of records per tableI am not really interested at this point about other database objects, such as queries or reports.

View 11 Replies View Related

Modules & VBA :: SQL Server - Conversion Failed When Converting Date And / Or Time From Character String

Feb 13, 2014

I have two table

1. dbo.period (OpeningDate, ClosingDate)
2. dbo.data (blah blah, doc_date)

I want to create a view as follows

Select doc_date from dbo.data
where doc_date> 'select OpeningDate from dbo.period'

both doc_date and opening date have the same format

but the error will still appear as follows:
"Conversion failed when converting date and / or time from character string."

View 3 Replies View Related







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