Ronbo Posted February 14, 2006 Posted February 14, 2006 Hi, Can anyone give me some suggestions on setting up an input mask so that when I enter date or time I don't have to type in the / or : seperators and can just type in the numbers instead? Thanks.
Raybaudi Posted February 14, 2006 Posted February 14, 2006 Hi check this custom function for the date problem BTW that custom wasn't made for american formatted date, but it will be no difficult to modify. (you have to enter that calc on a AutoEnter/Replace field)
Raybaudi Posted February 14, 2006 Posted February 14, 2006 Hi if you have read that custom, you'll know that the result will be a PseudoDate text (not a real date). To get a real date you have to use the function: GetAsDate (PseudoDate) The same will be for the time and the calc is: Let( isNumber = If( Filter ( yourPseudoTimeField ;"1234567890" ) = yourPseudoTimeField;1;0); Case( isNumber; Case( Length ( yourPseudoTimeField ) = 1; "00:00:0" & yourPseudoTimeField ; Length ( yourPseudoTimeField ) = 2;"00:00:" & yourPseudoTimeField; Length ( yourPseudoTimeField) = 3;"00:0" & Left ( yourPseudoTimeField ; 1 ) & ":" & Right ( yourPseudoTimeField ; 2 ); Length ( yourPseudoTimeField) = 4;"00:" & Left ( yourPseudoTimeField ; 2 ) & ":" & Right ( yourPseudoTimeField ; 2 ); Length ( yourPseudoTimeField) = 5;"0" & Left ( yourPseudoTimeField ; 1 ) & ":" & Middle ( yourPseudoTimeField ; 2;2 ) & ":" & Right ( yourPseudoTimeField ; 2 ); Length ( yourPseudoTimeField) = 6;Left ( yourPseudoTimeField ; 2 ) & ":" & Middle ( yourPseudoTimeField ; 3 ;2 ) & ":" & Right ( yourPseudoTimeField ; 2 ) ); "") )
Ronbo Posted February 16, 2006 Author Posted February 16, 2006 Thanks for coming to my rescue. Amazing that there isn't an easier way to do this. Once upon a time ago I used Access and it had a much easier way to setup input masks. Oh well. Thanks again!
Raybaudi Posted February 18, 2006 Posted February 18, 2006 Here is a little file for your Date problem. Date.zip
Recommended Posts
This topic is 6916 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now