y2kmental Posted December 26, 2006 Share Posted December 26, 2006 Is there a way to enable an input feild mask, so users dont have to enter the ':' in time.. 22:00, takes longer to enter 2200 would be easier -> transformed to 22:00 thanks Link to comment Share on other sites More sharing options...
comment Posted December 26, 2006 Share Posted December 26, 2006 I think you will find the answer here. Link to comment Share on other sites More sharing options...
y2kmental Posted December 26, 2006 Author Share Posted December 26, 2006 well it works when i type 24, it turns it to 24:00. But if i type 1645 it displays 1645: Link to comment Share on other sites More sharing options...
comment Posted December 26, 2006 Share Posted December 26, 2006 Check your implementation. When you input 24, it should turn to 00:24. Link to comment Share on other sites More sharing options...
Søren Dyhr Posted December 27, 2006 Share Posted December 27, 2006 When you input 24, it should turn to 00:24 Should it? I dissagree here as well. It should be more nested! If just one digit is entered should it go to the very first position before the ":" ...if two and the first perhaps is 0 should still go to position before the ":" ...if 3 ciffers, again with the distinction containing 0 as first digit or not etc. In short does it need to go into a Choose( statement using both the word length and a check if first, and counting of initial "0"'s Just some thoughts??? --sd Link to comment Share on other sites More sharing options...
Raybaudi Posted December 27, 2006 Share Posted December 27, 2006 ...so, Soren, something like this ? Choose( Length ( TimeField ) ;""; TimeField & ":00:00"; TimeField & ":00:00" ; Left ( TimeField ; 2 ) & ":" & Middle ( TimeField ; 3 ; 1 ) & "0:00"; Left ( TimeField ; 2 ) & ":" & Middle ( TimeField ; 3 ; 2 ) & ":00"; Left ( TimeField ; 2 ) & ":" & Middle ( TimeField ; 3 ; 2 ) & ":" & Middle ( TimeField ; 5 ; 1 ) & "0"; Left ( TimeField ; 2 ) & ":" & Middle ( TimeField ; 3 ; 2 ) & ":" & Middle ( TimeField ; 5 ; 2 ) ) Link to comment Share on other sites More sharing options...
comment Posted December 27, 2006 Share Posted December 27, 2006 I was referring to the calculation I have linked to. If implemented correctly, you should get 00:24 when you input 24. Whether that is the desired result, is another question. Link to comment Share on other sites More sharing options...
Søren Dyhr Posted December 28, 2006 Share Posted December 28, 2006 ...so, Soren, something like this ? No like this, after some considerations! GetAsText ( Time ( Int(Left(Left ( entry ; 2 ) & "0";2)) ; Int(Middle ( entry & "00" ; 3 ; 2 )) ; 0 ) ) Forcing the user to use a leading 0 when low hours.... here where no am/pm'ing is standard do I think it makes some sense. --sd Link to comment Share on other sites More sharing options...
theyetti Posted January 1, 2007 Share Posted January 1, 2007 Hi Søren, this one helped me as well, Thanks Pedro -) Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6319 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