Jump to content
Server Maintenance This Week. ×

Date and time fields concatenated.


This topic is 1894 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

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 by comment
  • Like 2
Link to comment
Share on other sites

Let ( [ 

from = GetAsTimestamp ( DateOfClass & " " & StartTime )  ; 
to = GetAsTimeStamp ( DateOfClass & " " & EndTime ) 

]; 

DateOfClass & " " & GetAsTime ( from ) & "-" & GetAsTime( to ) 

)

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.