Richard Sillitto Posted November 2, 2010 Posted November 2, 2010 Hi Everyone, Simple one here that is throwing my brain! I have a time entry field (recording the time a job started). So a user might enter "09:00" which is stored internally in FMP as "09:00:00" as shown by the data debug viewer. I then want to extract this time into a description field I use for an invoice line item. As I'm not interested in seconds, I use the following calc: Left ( Time_Start ; 5 ) And add this into the formation of the text description field with the usual concatenations. The result, however for the above example time is to produce: 9:00: ie the leading zero isn't being counted in the "5" characters extracted. Any quick and easy solutions. Seems to be that FMP isn't being very rigerous in how it's handling its time formats (ie it shows it one way in the data viewer, but handles it another in calcs). Cheers, Richard.
Vaughan Posted November 2, 2010 Posted November 2, 2010 Left ( Time_Start ; 5 ) Internally FMP stored the time as the number of seconds since midnight. The display of the time is dependent on the system localisation and it can change. Instead of using a calculation that makes assumptions about the time format, pull the hours and minutes out explicitly and concatenate them together: Hour( Time_Start ) & ":" & Minute( Time_Start ) All of this may be moot: you can change the time format of any field and set how it displays independently of the system and the other fields. Right-click on the field and choose Time format.
Recommended Posts
This topic is 5193 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