Subtracting Time Without Date Diff

Jan 23, 2008

Hi I have two fields one which represents the time participants went to sleep, one when they woke up however I dont have any dates - it refers to what they do usually. Is it possible to minus sleeptime from waketime to determine duration of time in bed without dates? Or do I assign dummy dates to use date diff function?

View Replies


ADVERTISEMENT

Subtracting 12 Hours From A Date-time Field

Nov 13, 2007

I am trying to subtract 12 hours from a time-date field when the payperiod does not equal 01.

in a query I have:

work date: iif([payperiod]="01",[StartTime],[starttime]-#12:00:00#) - Access added a PM before the second hash so it looks like this:

iif([payperiod]="01",[StartTime],[starttime]-#12:00:00 PM#)

When I run the query I get a message box: "syntax error (missing operator) in query expression '00:00:PM#,2))". I am unable to open the query to correct the error. I can cop the unaltered query from a back up database.

My question is how do I subtract the 12 hours.

Thanks

Steve

View 3 Replies View Related

Subtracting Date/time Field From Integer Field

Jan 2, 2007

Hello everyone, I'm encounter a problem trying to write a code.

EX:
Date Months_to_credit Final_result
01/31/06 4 10/01/05
02/28/06 6 09/01/05
03/31/06 8 08/01/05


Does anyone have any ideas how to to substract Months_to_credit from Date and to return a date in the Final_result field?

View 1 Replies View Related

Subtracting Time

Jun 20, 2006

I have two times I need to subtract in a query. When I subtract these in the query I get a decimal point. How can I convert this data. Thanks

View 1 Replies View Related

Subtracting Military Time

Oct 21, 2005

My new job requires me to use access so I'm learning as I go. :confused:
I have already used previous threads from this forum to answer another problem I encountered. Thanks for providing this forum to the public!

I am attemping to run a query that will subtract military time. (I am not allowed to change the format of the times in the original tables. )

Example:

Column A Column B
1111 6.5

I need 1111 - 6.5 in Column C

View 4 Replies View Related

Subtracting Time Over 24 Hours?

Mar 27, 2006

Any Help!

I have fields that are time formated 99/99/99" "00:00;0;_ and I want to subtract them.

I need to get the results in two forms; first in Days and second in Hours. I have used the obvious subtract one from the other and it gives me days in a rounded numbeer, but the hours is not working out.:confused:

DB

View 4 Replies View Related

Subtracting Time Fields

Mar 26, 2005

Before I start implementing this, I would like to know if it is possible to do in principle

I want two fields, say TimeStarted and TimeEnded. I then want to subtract the two from one another to see how long the task took.

Is this possible or would i be wasting my time trying it?

View 1 Replies View Related

Adding And Subtracting Short Time Values Together/changing Short Time Into Minutes

Dec 9, 2004

Hello again,

I think my subject heading explains it. How would you add or subtract two short time formatted values and produce a short time value? Also, how would you change a short time value into number minutes. (i.e. 5:30 into 330) Thanks!

G

View 1 Replies View Related

Date Diff

Jan 29, 2008

hi all

im looking at doing a query to check records for absense

the 1st will be checking if the person has been absense for 4 weeks (28days) so i will have to check from absense date to today does that equal or greater than 28 days but lesss than 91 days (13 weeks) and is the return to work date blank

is that possible???

View 6 Replies View Related

Date Diff

Nov 7, 2005

Hello,
I have a form on which I have places a textbox named txtDOB which stored a date of birth.
I have then another text box which has the following function:

=DateDiff("yyyy",[txtDOB],Now())+Int(Format(Now(),"mmdd")<Format([txtDOB],"mmdd"))

Is there a way I can show the age + months?

Thanks.

View 5 Replies View Related

Date Diff Problem

Mar 19, 2008

Hello,
I am having problems creating a Exp to show the difference in time.
I am currently using :Expr1:DateDiff("n",[TimeReported],[TimeDefectGiven]) which is returning a figure in decimal.
If the answer was to be 90 minutes i need it to return the figure as 1.50 instead.

I have looked on the site using Date Diff and Time without success


Any help given would be great

View 3 Replies View Related

Date Diff Question

Sep 18, 2007

I have a date field, I am trying to have my query only pull the records that have a date entry that is within and up to 90 days from today or Now. For this query all other records are irrelevant.

THis is what I have found so far

=(Abs(DateDiff("y",Now(),[ls_Exp Date])))

Can someone show me how to add the 90 days in there?

Thanks.

Fen How

View 3 Replies View Related

Date Diff Problem / Please Help.

Oct 11, 2007

I'm using the date diff .... DateDiff("h",[Start time],[End time]) in a query and then I report the results in a report. I have run into a problem for the first time. I had a start time of 7:00pm, and an end time of 7:00am. This was calculated in the query as (-12) which is messing up my cost formula.

How do I resolve this?

Jerry

View 3 Replies View Related

Date Diff In A Query

Apr 27, 2006

Here we go:

My overall goal is to find out a worker’s downtime (count of weeks between assignments)

I have a qry_Downtime that pull in a worker and his current and future assignment. Each assignment is associate with a start and end date.

Here is how the results look:

Employee (joe schmo)ProjectONE ProjectONEStartDateProjectONEEndDate
Employee (joe schmo)ProjectTWO ProjectTWOStartDateProjectTWOEndDate
Employee (joe schmo)ProjectTHREE ProjectTHREEStartDateProjectTHREEEndDate
Employee (joe schmo)ProjectFOUR ProjectFOURStartDateProjectFOUREndDate

Downtime would be defined the diff in weeks between ProjectONEEndDate and ProjectTWOStartDate, ProjectTWOEndDate and ProjectTHREEStartDate, etc.

Any suggestions.
T

View 5 Replies View Related

Date Diff Problem

Jun 14, 2006

Friends,

I have a problem with a date diff calculation:
On my form I have placed two controls, a text box and a check box.

The textbox contains is a date field (mm/dd/yyyy).
What I need is a code that checks the checkbox if the date in the textbox is within the last 12 months.
This is the code I am using but not working:

If DateDiff("yyyy", textbox, Now()) >= 1 Then
Me.check1 = "yes"
End If

Any help? Thanks.

View 11 Replies View Related

Queries :: Date Diff Expression

Oct 17, 2013

I am having a problem with a datediff expression.I have a query that pulls the first date and the last date out of a list but are put in seperate fields. I thought I could build an expression for datediff to calculate the number of dates between them. I can't just put in the dates because they are constently changing.The expression I have is:

[datediff("d",[min/max edging unit #2]![firstofupdate/time by month],[min/max edging unit #2]![lastofupdate/time by month])]

View 4 Replies View Related

Queries :: Dlookup Value From 1 Table With Date Ranges From Diff Table With A Single Date?

Mar 12, 2015

i have 2 tables.. 1 with bookings and 1 with a BonusPeriod range.

in the Bookings table there is a field called [ServiceDate]

in the bonus table i have a field called [Period] which is text i also have 2 dates, [StartDate] And [EndDate] i need to Dlookup the Bonus table to return the value of the period table based on where the [ServiceDate] falls.

i dont want to use VBA (i really need it to work within a query that inserts it's data into another table)

i've tried everything but had no joy

Expr1: DLookUp("[Period]","BonusPeriods","[ServiceDate]" Between "#[StartDate]#" And "#[EndDate]#")

Expr1: DLookUp("[Period]","BonusPeriods","[Staff_BookingsAndQuotes_Master].[ServiceDate]" Between "#[StartDate]#" And "#[EndDate]#")

Expr1: DLookUp("[Period]","BonusPeriods","(FormatDateTime([ServiceDate]),"yyyy-mm-dd") Between (FormatDateTime([BonusPeriods]![StartDate]),"yyyy-mm-dd") and (FormatDateTime([BonusPeriods]![EndDate],"yyyy-mm-dd"))))

View 10 Replies View Related

Queries :: Function To Calculate Date Diff In Network Days

Aug 7, 2014

I'm using the following function to calculate date diff in network days (excluding weekends)

Public Function NetWorkdays(dteStart As Date, dteEnd As Date) As Integer
Dim intGrossDays As Integer
Dim dteCurrDate As Date
Dim i As Integer
intGrossDays = DateDiff("d", dteStart, dteEnd)
NetWorkdays = 0

[Code] ....

So when using this function in a query to get number of networkdays between 2 date columns ...it works fine but throws a #Error where there is blank entries in either of 2 date columns...

I need to find a way to display Null instead of #Error...

I have tried this expression but no luck...

IIf(IsError(NetWorkdays([Date1],[Date2])),"",NetWorkdays([Date1],[Date2]))

View 7 Replies View Related

Subtracting Months From A Date In Query

May 30, 2006

I have a field called DATE_END_DEERS which is in a format of YYYYMMDD (20060530). I need to run a query that shows 6 months subtracted from this date. I can never get an answer that is even close. Can someone please help? ACCESS2000.

View 3 Replies View Related

Date Query - Subtracting Months

Apr 10, 2008

Hello Everyone,I have a query where I am trying to pull records where the user took a class that is 2.5 years old or newer based on their license expiration date. Can someone tell me what I'm missing/doing wrong?SELECT tblCE_Details.LIC_NUMBER, tblCE_Details.Course_Code, tblCE_Details.Course_Date, sociwork1.expirat_dtFROM Sociwork1 INNER JOIN tblCE_Details ON Sociwork1.LIC_NUMBER = tblCE_Details.LIC_NUMBERWHERE (tblCE_Details.LIC_NUMBER = Forms![SW form]!SLIC_NUMBER) AND tblCE_Details.Course_Date >= (sociwork1.expirat_dt - Month(30))ORDER BY tblCE_Details.Course_Date;Thanks,Crhodus

View 3 Replies View Related

Queries :: Subtracting Numeric Value From Date Value

Jan 15, 2015

in my query to subtract [Days] (Numeric Value) from a date field [TravelDate]

View 4 Replies View Related

Queries :: Subtracting Date Fields

Jul 10, 2013

I have an Access query which has 2 fields 'Sent Date' and 'Return Date'. Sent date is input by the user when they return an item for repair, return date is input by the user when the item is sent back to us from repair. What I need is a 3rd calculated field which will work out the number of days the item was away for repair. I have included the 3rd column 'Repair Duration' but I don't know how to type the formula in the query to work this out.

View 7 Replies View Related

Adding And Subtracting Dates From Current Date

May 7, 2013

My first question is how to set a column to be the current date read by the computer.

Example: It will automatically say 5/8/2013 tomorrow without needing updating.

Question 2: How to add a number of days to the current date.

Example:

Add 7 days to the current date.

on 5/8/2013 it will read 5/15/2013, then automatically update to 5/16/2013 on 5/9.

View 1 Replies View Related

Hard Code TIME To Selected Date On Form (to Make It Date&time) For My Query Criteria

Aug 17, 2006

Hello buddies :D, do you have any idea how to make this work?

To select data that falls within this criteria of date range between cboDate and cboDate2 (fields on my form). The date in [tblJobDetails]![timeIn] come in this format "08/17/06 10:24 AM", but the cboDate/cboDate2 (takes in date only e.g 08/17/06) what i am after is to evaluate specific hard coded time in addition to the date entered, i.e. even tho, i haven't entered time on the cboDate/cboDate2, I want specific time hard coded where e.g If i select a date range of 08/17/06 and 08/18/06 on my cboDate and cboDate2 it should really be evaluating: 08/17/06 8:00 AM to 08/18/06 8:00 AM.

This is the criteria i curentlly have on my query in design view tha works perfect in selecting date only.
([tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Or [tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Is Null) And ([tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Or [tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Is Null)
How can I incorporate 8:00am to 8:00am into my cboDate and cboDate2. What can i do to make this happen? Your kindness will be greatly appreciated http://www.naijaryders.com/forums/images/smilies/thankyou.gif

View 10 Replies View Related

Date Diff [DATE] & Now

May 31, 2007

Is there a way in a query I can add a Date Diff option to calculate the time between a date that is in the query and now?

I was trying something like this but no luck

=DateDiff("d", [DateToPerson], [now])

Thanks

View 9 Replies View Related

Queries :: Getting Date / Time Range - Date And Time Are Separate Fields

Mar 13, 2014

I have a database with date and time each stored in a separate field. Now I want to query the database based on a start date/time and an end date/time. I started with the code below but it only returns events within the same time range on each day when what I really need is every event from a specified date and time through a specified date and time.

SELECT myTable.ID AS myTable_ID, myDate, myTime, FirstName, LastName
FROM Staff INNER JOIN myTable ON
Staff.ID = myTable.StaffID
WHERE myTable.myDate >= #3/2/2014#
AND myTable.myDate <= #3/3/2014#
AND myTable.myTime >= #8:00PM#
AND myTable.myTime <= #11:00PM#
ORDER BY myDate desc

In the above example what I want is every event from 3/2/2014 8:00PM until 3/3/2014 11:00PM. But what I get instead is every event between 8:00PM and 11:00PM on 3/2/2014 and every event between 8:00PM and 11:00PM on 3/3/2014.

View 4 Replies View Related







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