Jump to content

Concatenating legacy 'Stamp' fields


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

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 . . . 

Link to comment
Share on other sites

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

This topic is 2072 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.