chiggins68 Posted February 12, 2019 Share Posted February 12, 2019 Have a form for creating classes. In it have four fields. name of class (formatted as text) date of class (field formatted as Date) start time of class (formatted as Time) end time of class (formatted as Time) How do I concatenate so that they can show up on a form as "1/1/2019 1:00pm-2:00pm". I was able to use GetAsText function on the date and time fields so I could get concatenation but now they read "1/1/2019 13:00pm-14:00pm " Link to comment Share on other sites More sharing options...
comment Posted February 12, 2019 Share Posted February 12, 2019 (edited) If this is for display only, you can merge all 3 fields in a single text block and format them the same way you would format date and time fields placed directly onto the layout. If you want a calculated result (result type is Text), try = ClassDate & " " & Mod ( Hour ( StartTime ) - 1 ; 12 ) + 1 & SerialIncrement ( ":00" ; Minute ( StartTime ) ) & If ( StartTime < 43200 ; "am" ; "pm" ) & "-" & Mod ( Hour ( EndTime ) - 1 ; 12 ) + 1 & SerialIncrement ( ":00" ; Minute ( EndTime ) ) & If ( EndTime < 43200 ; "am" ; "pm" ) Edited February 12, 2019 by comment 2 Link to comment Share on other sites More sharing options...
Ocean West Posted February 12, 2019 Share Posted February 12, 2019 Let ( [ from = GetAsTimestamp ( DateOfClass & " " & StartTime ) ; to = GetAsTimeStamp ( DateOfClass & " " & EndTime ) ]; DateOfClass & " " & GetAsTime ( from ) & "-" & GetAsTime( to ) ) 1 Link to comment Share on other sites More sharing options...
Ocean West Posted February 13, 2019 Share Posted February 13, 2019 @comment clever use of SerialIncrement - aways forget that one. Link to comment Share on other sites More sharing options...
chiggins68 Posted February 18, 2019 Author Share Posted February 18, 2019 Thank you both for your help! I had not used either of these functions before. The great thing about sharing a solution is looking up the function and realizing you can use it elsewhere. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 1894 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