Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Dates and times

Discussion in 'Information Technology' started by PhilSmith, Jul 28, 2006.

Tags:
  1. PhilSmith

    PhilSmith
    Expand Collapse
    Guest

    I am working on database which has 2 fields imported from an Excel speadsheet
    - a start date and time and a finish date and time. I need Acces to
    automatically calculate the difference in a third field and then calculate
    whether an SLA was met. Therefore I need to calculate in a fourth column
    some sort of IF statement. I've never done this before. Any help gratefully
    received. Phil.
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News BREAKING: Young Sikh Shot Dead In Jalalabad, Afghanistan . - Sikh24 News & Updates Breaking News Oct 2, 2016
    Pacific Oil slicks spotted in search for missing Malaysia Airlines plane (Live updates) Breaking News Mar 8, 2014
    India Candidates flock to Dera Sacha Sauda Breaking News Jan 17, 2012
    India Seven SAD Candidates of SGPC Win Unopposed Breaking News Aug 27, 2011
    GurmatChanan Updates Gurbani Download Aug 27, 2011

  3. Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

    Hi Phil,

    One of these articles should be helpful to you when working with dates:

    How to store, calculate, and compare Date/Time data in Microsoft Access
    http://support.microsoft.com/?id=210276

    How to Calculate Daily Hours Based on Clock In/Clock Out Times
    http://support.microsoft.com/?id=237958

    On time and how much has elapsed
    http://office.microsoft.com/en-us/assistance/HA011102181033.aspx

    Using dates and times in Access
    http://office.microsoft.com/en-us/assistance/HA010546621033.aspx

    Calculate Number of Working Days
    http://www.mvps.org/access/datetime/date0006.htm

    Doing WorkDay Math in VBA
    http://www.mvps.org/access/datetime/date0012.htm


    Tom Wickerath
    Microsoft Access MVP

    http://www.access.qbuilt.com/html/expert_contributors.html
    http://www.access.qbuilt.com/html/search.html
    __________________________________________


    "PhilSmith" wrote:

    > I am working on database which has 2 fields imported from an Excel speadsheet
    > - a start date and time and a finish date and time. I need Acces to
    > automatically calculate the difference in a third field and then calculate
    > whether an SLA was met. Therefore I need to calculate in a fourth column
    > some sort of IF statement. I've never done this before. Any help gratefully
    > received. Phil.
     
  4. Arvin Meyer [MVP]

    Arvin Meyer [MVP]
    Expand Collapse
    Guest

    To calculate the date difference use the datediff() function:

    DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])

    So try someting like in a query column:

    Difference: DateDiff("h", [FinishDate], [Start Date])

    then use the Immediate If function IIF()

    IIf(expr, truepart, falsepart)

    so you'd do something like:

    SLA_Met: IIF([Difference] > 4, -1, 0)
    --
    Arvin Meyer, MCP, MVP
    Microsoft Access
    Free Access downloads
    http://www.datastrat.com
    http://www.mvps.org/access

    "PhilSmith" <PhilSmith@discussions.microsoft.com> wrote in message
    news:86DC8A5C-5997-43AA-85CF-CCF96EDA0FCC@microsoft.com...
    > I am working on database which has 2 fields imported from an Excel

    speadsheet
    > - a start date and time and a finish date and time. I need Acces to
    > automatically calculate the difference in a third field and then calculate
    > whether an SLA was met. Therefore I need to calculate in a fourth column
    > some sort of IF statement. I've never done this before. Any help

    gratefully
    > received. Phil.
     

Share This Page