You are the best person to decide what is suitable to you. I tried to add my bit to your thinking process.
You are the best person to decide what is suitable to you. I tried to add my bit to your thinking process.
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.
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.
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.
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.
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.
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.
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.
Sorry I am just experimenting 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.Experiment with and without those parameters.
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 ?
I seeBecause entering just 00:13 in a date/time field is really: 1/1/1899 00:13:00 AM
OkCan: 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.
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.
If I have or don't have this ;_Experiment with and without it. What do you see when you click in the textbox?
I still see this
__/__/20__ __:__ _M
when I click on the textbox
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.
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.It doesn't specify about 0/1, some testing would determine what happens if left off.
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.
Yup!! :-)Oh well, as long as something works.![]()