Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Concatenating legacy 'Stamp' fields

Featured Replies

I am updating a database where the legacy solution has separate Fields for Date and Time, which were set via "auto enter" options.

In the new solution I'm thinking perhaps I should replace them with a single "Timestamp" field, but wondering whether there are reasons not to . . . so

1) Can I simply concatenate the legacy data in the two fields for the existing records, with a space between them?  Will they "behave" like the fresh records where the full timestamp is auto-entered?

2) Is there a way to display *only* the date, or *only* the time when placing a 'Timestamp' field on a layout?  I'm not seeing a way to do this . . . so is it best to just have separate fields if you might want to 'suppress' one or the other in a given display?

thanks!

Edited by Wickerman

2 is easier.  You can display a button bar, 2 buttons, that look like the fields with these calculations (one per button):

GetAsDate(Table::Timestampfield) //shows only the date portion of a timestamp

GetAsTime(Table::Timestampfield)//shows only time.

1.  I would think you could write a script that concatenates.  The date field & " " time field, placed in a timestamp field would work.

Depends on how precise you need it.  Timestamp would be better

  • Author

Thanks very much!  yeah, I'm thinking it's probably just as easy to keep two fields after all . . .

But with regard to the concatenation, I'm still a little fuzzy.  What I'm envisioning is once I've imported the records I create a separate, new TimeStamp field, which will then be empty for all current records. I would just "Show all records" and then do a "Replace field Contents" for the Timestamp field, using the concatenation you describe as the Calc.  Then going forward, the Timestamp is auto-entering and we're all set, and I can delete those separate legacy fields.

So . . . if I did that, would there be any way of telling the difference between the legacy data that I concatenated and the auto-entered entries for new records?  I'm hoping there would be no difference.    I think if there were any difference at all, I wouldn't want to do this . . . 

I can't test this but I would first make the timestamp an unstored calculation field with timestamp as the calculation result.  It will make your timestamps for you.  Then change it to a timestamp field, either creation or modification.  After that all new records would get a proper timestamp

Edit:

The above won't work.  What you recommended will work

First, try on backup copy of file.

Make a timestamp field, no options (modification, creation, auto enter).

 Then go to your records, make sure all timestamp fields are empty and use Replace Field Contents with the calculation:

Table::DateField & " " & Table::TimeField

Then your timestamp field looks like it should.

Then go back into Manage Database and change your timestamp field with the proper auto enter option (creation/modification).

Edited by Steve Martino
initial wrong info.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.