Anuviel Posted September 14, 2007 Share Posted September 14, 2007 Hi, working on a simple time card system. Is there a way to make it to be able to enter 1800 into a time field and have the field format it as 18:00 automatically? I checked the time display options and if I for example set the separator to . and enter 10.00 is returns 00:00, if I enter 10:00 it returns 10.00 - what I want to achieve is to not have to type : when entering time so it will be easier for my boss to type in the times not having to type : every time, it will be faster to. So in summation I want to enter 1800 into time field and have it automatically formated as 18:00 or enter 513 and have it formated as 05:13 automatically if such a thing is possible. Thank you kindly for your help with this matter. Link to comment Share on other sites More sharing options...
comment Posted September 14, 2007 Share Posted September 14, 2007 Formatting the display has very little to do with the method of data entry. To enable time entry with no colon, set the field to auto-enter (with replacing) a calculation: Replace ( Right ( "0000" & TimeField ; 4 ) ; 3 ; 0 ; ":" ) Format the field to display the time in whatever format you prefer. Link to comment Share on other sites More sharing options...
Anuviel Posted September 14, 2007 Author Share Posted September 14, 2007 Thank you so much : will remember this. Link to comment Share on other sites More sharing options...
Raybaudi Posted September 14, 2007 Share Posted September 14, 2007 Replace ( Right ( "0000" & TimeField ; 4 ) ; 3 ; 0 ; ":" ) Hi comment are you sure ? I haven't FMP on this computer but, if I remember correctly, the validation of data entry in a time field comes before the autoenter calc. Link to comment Share on other sites More sharing options...
comment Posted September 14, 2007 Share Posted September 14, 2007 I believe you are thinking of a DATE field? Link to comment Share on other sites More sharing options...
Anuviel Posted September 14, 2007 Author Share Posted September 14, 2007 Yes, Comments solution works beautifully. If you however check the data restriction to Time of the Day, it does not work but then again I do not need that function. Thank you. Link to comment Share on other sites More sharing options...
Anuviel Posted September 14, 2007 Author Share Posted September 14, 2007 Ok, time is difficult. I have a following calculation: If ( Total_Week > "40:00:00" ; Total_Week - "40:00:00" ; "" ) The result that I am getting is -70:36:40 (Total_Week = 40:30) All fields are set time and the calc results are time. I tried with result as number and I tried with 40 and 40:00 in the calculation and it is not happening. I am trying to get overtime. If Total work hours in a week are 40 I want to deduct 40 from that total to get the overtime. Where am I going wrong? Link to comment Share on other sites More sharing options...
comment Posted September 14, 2007 Share Posted September 14, 2007 "40:00:00" is not time. It's a text string, that in the course of your calculation gets converted to a number - so in the end you're subtracting 400,000 seconds from your total. Use either GetAsTime ("40:00:00" ) or Time ( 40 ; 0 ; 0 ) to express a time constant. Link to comment Share on other sites More sharing options...
Anuviel Posted September 14, 2007 Author Share Posted September 14, 2007 WoW, than you so much. Awesome - btw any documentation or a book you can recommend where I could look up things like these - do not have any atm... Thank you., Link to comment Share on other sites More sharing options...
comment Posted September 14, 2007 Share Posted September 14, 2007 I'm not up on that, but you could check out the forum's Resources section. Link to comment Share on other sites More sharing options...
Anuviel Posted September 14, 2007 Author Share Posted September 14, 2007 Thank you. Link to comment Share on other sites More sharing options...
Anuviel Posted September 15, 2007 Author Share Posted September 15, 2007 Maybe too much to ask but how would I go about calculating salary? I tried with number as a result and I tried with GetAsNumber and it did not work. How do I tell it to multiply 40 hours with $10.00 and give me $400.00. The results I am getting are not friendly. Thank you. Link to comment Share on other sites More sharing options...
comment Posted September 15, 2007 Share Posted September 15, 2007 Time is measured in seconds, so TimeWorked * HourlyRate / 3600 should be your basic formula. Link to comment Share on other sites More sharing options...
Anuviel Posted September 15, 2007 Author Share Posted September 15, 2007 Thank you, much appreciated, all set - learned a lot. : Link to comment Share on other sites More sharing options...
Anuviel Posted September 18, 2007 Author Share Posted September 18, 2007 Almost done. Missing a critical thing that I just cannot succeed to make. Even tried writing a custom function to get what I want - the function worked and did what I told it to do but I told it to do something other then what I want as I am not able to/ do not know to put in calc terms what I want or it might be solved with a relationship/count method? In my Weeks table when I create daily in/out for employees (created via portal in Week table which creates line items in Week line item table) I enter start of the week date. Now, when I enter 9/18/07 as a week start I want the first record in the line items table to have a date of 9/18/07, second record should have a date of 9/19/07, following record 9/20/07 and so on until I am done entering days for that week. The dates should be created automatically based on the Start of the week date. I tried with a new self join relation and count(date) + 1 but it did not work - I defined the relationship wrong or did the calculation from wrong table or something like that. Thank you., Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6199 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