Page 2 of 2 FirstFirst 12
Results 16 to 29 of 29
  1. #16
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616

    You are the best person to decide what is suitable to you. I tried to add my bit to your thinking process.

  2. #17
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    The 0 means to save the value with the punctuation. A 1 would mean no punctuation. This would be applicable for values like phone numbers or SSN. Some prefer to save without hyphens and parens.

    The _ is a placeholder in the mask.

    Experiment with and without those parameters.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Ok, thanks. so I have another case where I just want to input the minutes.
    I couldn't do it, it doesn't seem like that table are accepting it, and also I tried an input mask but it didn't work out correctly.

    the point is to have a field in the form where I could just enter the minutes and this can then be added to a date/time field.

  4. #19
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Minutes alone? What use is that without the hour of the day? Is this elapsed time in minutes? That would not be date/time field, just number type.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    hours would be fine, but I think a lot of times it would end up being minutes unless it goes over to the hours.
    I have a field that is now date/time, and I have another form with distance (miles) and times only, no date, and this time field is going to
    add with the date/time field for calculation to see how long is taking a train to go from point A to point B.

    is fine if hours are added, but if the minutes doesn't go over the hours or if it does it would still be able to add to the date/time field.

    00:15 so this would mean 15 mins, if this is added to 11/15/2013 7:05 am it would equal to 11/15/2013 7:20 am
    01:05 so this would mean 1 hour and 5 mins but can also add to a field that is like this 11/15/2013 7:05 am, if added would equal to 11/15/2013 8:10 am

    most of the time the field wouldn't go over an hour but if it's also hours it wouldn't hurt if it can be added to the date/time field.

    When I say added, meaning I run a query calculation with those two fields.
    Last edited by johnseito; 11-15-2013 at 08:19 PM.

  6. #21
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Can't add 00:15 or 01:05 to a date value.

    Can add 15 or 65.

    DateAdd("n", 15, #11/15/2013 7:05 AM#) = 11/15/2013 7:20 M

    01:05 is 65 minutes

    DateAdd("n", 65, #11/15/2013 7:05 AM#) = 11/15/2013 8:10 AM
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #22
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Ok I see, so that means the field for mins should be integer type and that is what I did to it.

    Then I created a query to add the date/time field along with the number (integer) for minutes and
    tested it and see how it works and I got an answer.

    Code:
     
    SELECT trains.depart, lineStation.time, DateAdd("n", linestation.time, trains.depart)
    FROM  lineStation INNER JOIN 
                  (
                          (trains INNER JOIN bookingLeg ON trains.trainID = bookingLeg.tid)
                          INNER JOIN station ON bookingLeg.startID = station.stationID 
                  )
                         ON station.stationID = lineStation.stationID

    the result is

    depart time (mins) Expr1002
    7/31/2012 3:29:00 PM 13 7/31/2012 3:42:00 PM


    I wonder why it doesn't work for minutes but rather integers?

    can it be field A + field B as laterTIME
    field A is the date/time and field B is the minutes.

    I guess not since it worked the other way.

  8. #23
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Because entering just 00:13 in a date/time field is really: 1/1/1899 00:13:00 AM

    In a text field it would be just a 5-character text string.


    Can: 7/31/2013 3:29:00 PM + 13

    But that will add days because day unit is default.


    That's why elapsed time should be stored as a number (integer or double) and use DateAdd() function.


    Or save start time and end time and calculate elapsed difference with DateDiff() function.


    BTW, advise no spaces or special characters/punctuation (underscore is exception) in names.

    Better would be TimeMinutes or Time_Minutes or TimeInMinutes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #24
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Sorry I am just experimenting with and without those parameters.

    Experiment with and without those parameters.
    I took out ;0;_ and it gives me an error message. The value you entered isn't valid for this field, you many have entered text in a numeric field or number that is larger than the fieldsize setting permits.
    but if I leave ;0 they are fine, but if I have ;1, the error message shows again. When you say punctuation you meant / and : and so the 0 allows it and 1 doesn't so that is why I got an error message when
    I have a 1 vs a 0.


    not sure what the ;_ is for if it already works for ;0 ?

  10. #25
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Because entering just 00:13 in a date/time field is really: 1/1/1899 00:13:00 AM
    I see

    Can: 7/31/2013 3:29:00 PM + 13

    But that will add days because day unit is default.
    Ok


    BTW, advise no spaces or special characters/punctuation (underscore is exception) in names.

    Better would be TimeMinutes or Time_Minutes or TimeInMinutes.
    Ok :-)

  11. #26
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    The input mask _ parameter is a placeholder. Experiment with and without it. What do you see when you click in the textbox?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #27
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Experiment with and without it. What do you see when you click in the textbox?
    If I have or don't have this ;_
    I still see this
    __/__/20__ __:__ _M

    when I click on the textbox

  13. #28
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Interesting. When I checked this input mask in 2007 it acted differently than I see in 2010 when I remove the ;_

    However, I just checked the Help and find out the _ is default. It doesn't specify about 0/1, some testing would determine what happens if left off. Now I am not sure what was happening with the 2007. Oh well, as long as something works.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #29
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    It doesn't specify about 0/1, some testing would determine what happens if left off.
    If I take out the 0 and put nothing there, there would be an error, if I replace the 0 with the 1, also there would be an error.
    The 0 seems to have to be there, and the ;_ is not needed as I have tested and it works without it, but I left it there anyway.

    Oh well, as long as something works.
    Yup!! :-)

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Calendar Button to Select Dates
    By CementCarver in forum Forms
    Replies: 9
    Last Post: 04-20-2013, 09:15 AM
  2. Choose the row with the MOST RECENT date
    By taimysho0 in forum Queries
    Replies: 1
    Last Post: 05-14-2012, 02:35 PM
  3. Using form combo box in query to select date.
    By LordNecro in forum Access
    Replies: 2
    Last Post: 04-14-2012, 05:09 AM
  4. Custom calendar - select multiple dates
    By larek in forum Access
    Replies: 6
    Last Post: 06-23-2011, 02:40 AM
  5. Set Calendar to default to today's date
    By RickM in forum Access
    Replies: 1
    Last Post: 02-22-2009, 04:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums