Time isn't on my side

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve M

    Time isn't on my side

    I have a field in a query that shows various times stored in a table
    (7:40 PM, 8:10 AM, etc.). I want to create an expression in another
    field in the query that will add 10 minutes to each time from the
    first field. So when I run the query I will have 2 columns. Column 1:
    7:40 PM, 8:10 AM and Column 2: 7:50 PM, 8:20 AM. I know it must be
    simple but I can't write an expression that works right.
    Thanks
  • PC Datasheet

    #2
    Re: Time isn't on my side

    What do you ant to do if the time in the first column is between 11:50PM and
    1159 PM? Adding 10 minutes will take you into the next day.

    --
    PC Datasheet
    Your Resource For Help With Access, Excel And Word Applications
    resource@pcdata sheet.com



    "Steve M" <stevem@crprod. com> wrote in message
    news:dea080df.0 407142202.521cb fee@posting.goo gle.com...[color=blue]
    > I have a field in a query that shows various times stored in a table
    > (7:40 PM, 8:10 AM, etc.). I want to create an expression in another
    > field in the query that will add 10 minutes to each time from the
    > first field. So when I run the query I will have 2 columns. Column 1:
    > 7:40 PM, 8:10 AM and Column 2: 7:50 PM, 8:20 AM. I know it must be
    > simple but I can't write an expression that works right.
    > Thanks[/color]


    Comment

    • Allen Browne

      #3
      Re: Time isn't on my side

      Assuming the field is called StartTime, and you want the calculated field
      called EndTime, type this into the Field row of the query design grid:

      EndDate: DateAdd("n", 10, [StartTime])

      Be sure to use N for miNutes. M adds months.

      --
      Allen Browne - Microsoft MVP. Perth, Western Australia.
      Tips for Access users - http://allenbrowne.com/tips.html
      Reply to group, rather than allenbrowne at mvps dot org.

      "Steve M" <stevem@crprod. com> wrote in message
      news:dea080df.0 407142202.521cb fee@posting.goo gle.com...[color=blue]
      > I have a field in a query that shows various times stored in a table
      > (7:40 PM, 8:10 AM, etc.). I want to create an expression in another
      > field in the query that will add 10 minutes to each time from the
      > first field. So when I run the query I will have 2 columns. Column 1:
      > 7:40 PM, 8:10 AM and Column 2: 7:50 PM, 8:20 AM. I know it must be
      > simple but I can't write an expression that works right.
      > Thanks[/color]


      Comment

      • Steve M

        #4
        Re: Time isn't on my side

        Thanks, I think I see where the mistake was in my expression. I will
        try this when I get to work.


        "Allen Browne" <AllenBrowne@Se eSig.Invalid> wrote in message news:<40f62e14$ 0$1290$5a62ac22 @per-qv1-newsreader-01.iinet.net.au >...[color=blue]
        > Assuming the field is called StartTime, and you want the calculated field
        > called EndTime, type this into the Field row of the query design grid:
        >
        > EndDate: DateAdd("n", 10, [StartTime])
        >
        > Be sure to use N for miNutes. M adds months.
        >
        > --
        > Allen Browne - Microsoft MVP. Perth, Western Australia.
        > Tips for Access users - http://allenbrowne.com/tips.html
        > Reply to group, rather than allenbrowne at mvps dot org.
        >
        > "Steve M" <stevem@crprod. com> wrote in message
        > news:dea080df.0 407142202.521cb fee@posting.goo gle.com...[color=green]
        > > I have a field in a query that shows various times stored in a table
        > > (7:40 PM, 8:10 AM, etc.). I want to create an expression in another
        > > field in the query that will add 10 minutes to each time from the
        > > first field. So when I run the query I will have 2 columns. Column 1:
        > > 7:40 PM, 8:10 AM and Column 2: 7:50 PM, 8:20 AM. I know it must be
        > > simple but I can't write an expression that works right.
        > > Thanks[/color][/color]

        Comment

        Working...