Jump to content
Salesforce and other SMB Solutions are coming soon. ×

How to capture the first modified date


kenyonr
 Share

Recommended Posts

Hi,

 

I'm looking for a way to capture the first time an existing record is modified and keep that date, no matter if it is modified again. I can't use created date because these records exist already.

 

Help please?

Link to comment
Share on other sites

Personally, all my tables have a creation timestamp and modification timestamp. If you ever need to synch these records (or go back in time), it would be impossible otherwise. Since you don't have a creation date, start by adding one. Create field (date) called CreationDate. Don't set it to auto-enter (yet). The creation date you insert won't be right anyway, but at least it'll give you a starting point. Show all records, type a creation date of yesterday in any field, then (while cursor is still in this field), select Records > Replace Field Contents. It will pop up selecting 'Replace with: (your date)'. Then select REPLACE. Now in field definitions, change that CreationDate to Auto-Enter automatically 'Creation Date'.

 

Do the same with a ModificationDate. Make it the same date as your creation date for the Replace Contents then turn on the Auto-Enter and select automatically 'Modification Date.' Now you're primed. Create a new field called FirstModified (date) and put this in the Auto-Enter (with 'do not replace' CHECKED):

 

If (

not FirstModifyDate and ModificationDate > CreationDate ; ModificationDate ) ; FirstModifyDate

)

 

But what if a record is modified on the same day it is created? That is why I use timestamps instead of straight dates. If you use a timestamp then the comparison between Modification timestamp and Creation timestamp would fire the FirstModify field even if modified on the same date but later. It depends upon what you want here. But you SHOULD always have both Creation and Modification regardless. So I suggest you create them as timestamps and adjust my response accordingly.

 

LaRetta

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use