![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I have a auto-create timestamp field that I've formatted through the date and time format dialog boxes to be very close to what I need: YYYYmm dd hhmm (24 hr clock, always 2 characters for month and day). I need to export the time stamp into another application, and it would be helpful to have the timestamp without spaces. In order to get rid of the spaces, which I found I can do with Substitute (timestamp_field);" "; "") But to accomplish this, I have put the date into a calculated field, which reverts the timestamp into what seems to be a default format - e.g., 5/9/2007 6:42:39 PM. Hmm, I lose my original timestamp formatting when I change timestamp to text in the calculation to demolish spaces. I've been looking through the help files here and see that I'm not alone - but I haven't been able to write the correct formula to remedy my situation and reformat the timestamp. What I need is an auto-create timestamp in the format YYYYmmddhhmm (24 hr clock, always 2 characters for month and day). Any suggestions? Thanks so much for your time, it is always much appreciated! enJoy, cat |
#3
| |||
| |||
|
|
On 9 May 2007 19:29:02 -0700, cat <cathyty... (AT) gmail (DOT) com> wrote: Hello, I have a auto-createtimestampfield that I've formatted through the date and time format dialog boxes to be very close to what I need: YYYYmm dd hhmm (24 hr clock, always 2 characters for month and day). I need to export the time stamp into another application, and it would be helpful to have thetimestampwithout spaces. In order to get rid of the spaces, which I found I can do with Substitute (timestamp_field);" "; "") But to accomplish this, I have put the date into a calculated field, which reverts thetimestampinto what seems to be a default format - e.g., 5/9/2007 6:42:39 PM. Hmm, I lose my originaltimestamp formatting when I changetimestampto text in the calculation to demolish spaces. I've been looking through the help files here and see that I'm not alone - but I haven't been able to write the correct formula to remedy my situation and reformat thetimestamp. What I need is an auto-createtimestampin the format YYYYmmddhhmm (24 hr clock, always 2 characters for month and day). Any suggestions? Thanks so much for your time, it is always much appreciated! enJoy, cat Try creating a calculation field based on yourtimestamp. For the calc use a Filter statement to extract the spaces and other extraneous characters. Something like this: [newfield] = Filter ( [timestamp]; "1234567890" ) Make sure your originaltimestamphas everything in the same order you want your new one to have, i/e YYYY/MM/DD hh:mm will yield YYYYMMDDhhmm. Hope this helps. -- FW |
#4
| |||
| |||
|
|
On May 9, 10:55 pm, FastWolf <wolfsof... (AT) gmail (DOT) com> wrote: On 9 May 2007 19:29:02 -0700, cat <cathyty... (AT) gmail (DOT) com> wrote: Hello, I have a auto-createtimestampfield that I've formatted through the date and time format dialog boxes to be very close to what I need: YYYYmm dd hhmm (24 hr clock, always 2 characters for month and day). I need to export the time stamp into another application, and it would be helpful to have thetimestampwithout spaces. In order to get rid of the spaces, which I found I can do with Substitute (timestamp_field);" "; "") But to accomplish this, I have put the date into a calculated field, which reverts thetimestampinto what seems to be a default format - e.g., 5/9/2007 6:42:39 PM. Hmm, I lose my originaltimestamp formatting when I changetimestampto text in the calculation to demolish spaces. I've been looking through the help files here and see that I'm not alone - but I haven't been able to write the correct formula to remedy my situation and reformat thetimestamp. What I need is an auto-createtimestampin the format YYYYmmddhhmm (24 hr clock, always 2 characters for month and day). Any suggestions? Thanks so much for your time, it is always much appreciated! enJoy, cat Try creating a calculation field based on yourtimestamp. For the calc use a Filter statement to extract the spaces and other extraneous characters. Something like this: [newfield] = Filter ( [timestamp]; "1234567890" ) Make sure your originaltimestamphas everything in the same order you want your new one to have, i/e YYYY/MM/DD hh:mm will yield YYYYMMDDhhmm. Hope this helps. -- FW Thanks for your suggestion - there is a problem though. The filter works as you said, but FM still does not retain my timestamp format through the filter calculation. Perhaps ANY calculation would translate the timestamp to text and therfore revert the timestamp format to FM default of 5/9/2007 6:42:39 PM. So, even though I use your filter on my formatted timestamp of YYYYmmddhhmm (24 hr clock, always 2 characters for month and day), what I get is 59200764239 - (FM default timestamp format without the spaces and non-numeric characters). For what I need, this result is in the wrong order, includes the seconds, is a 12 hour clock, and has only one character for 1 digit month or day, e.g., May: 5 instead of 05. Another concern I have - if the default date format is actually coming from my computer's clock, I may have another issue to tackle. This project is being used in a run-time solution, meaning it will live on various host computers, which I suppose could have various default date formats....so I think I need a calculation that works with the parts of a timestamp, rather than trimming and rearranging text...maybe, maybe not?? Still stuck...but I liked learning the Filter function - very cool! Any other possible solutions? |
#5
| |||
| |||
|
|
On May 9, 10:55 pm, FastWolf <wolfsof... (AT) gmail (DOT) com> wrote: On 9 May 2007 19:29:02 -0700, cat <cathyty... (AT) gmail (DOT) com> wrote: Hello, I have a auto-createtimestampfield that I've formatted through the date and time format dialog boxes to be very close to what I need: YYYYmm dd hhmm (24 hr clock, always 2 characters for month and day). I need to export the time stamp into another application, and it would be helpful to have thetimestampwithout spaces. In order to get rid of the spaces, which I found I can do with Substitute (timestamp_field);" "; "") But to accomplish this, I have put the date into a calculated field, which reverts thetimestampinto what seems to be a default format - e.g., 5/9/2007 6:42:39 PM. Hmm, I lose my originaltimestamp formatting when I changetimestampto text in the calculation to demolish spaces. I've been looking through the help files here and see that I'm not alone - but I haven't been able to write the correct formula to remedy my situation and reformat thetimestamp. What I need is an auto-createtimestampin the format YYYYmmddhhmm (24 hr clock, always 2 characters for month and day). Any suggestions? Thanks so much for your time, it is always much appreciated! enJoy, cat Try creating a calculation field based on yourtimestamp. For the calc use a Filter statement to extract the spaces and other extraneous characters. Something like this: [newfield] = Filter ( [timestamp]; "1234567890" ) Make sure your originaltimestamphas everything in the same order you want your new one to have, i/e YYYY/MM/DD hh:mm will yield YYYYMMDDhhmm. Hope this helps. -- FW Thanks for your suggestion - there is a problem though. The filter works as you said, but FM still does not retain my timestamp format through the filter calculation. Perhaps ANY calculation would translate the timestamp to text and therfore revert the timestamp format to FM default of 5/9/2007 6:42:39 PM. So, even though I use your filter on my formatted timestamp of YYYYmmddhhmm (24 hr clock, always 2 characters for month and day), what I get is 59200764239 - (FM default timestamp format without the spaces and non-numeric characters). For what I need, this result is in the wrong order, includes the seconds, is a 12 hour clock, and has only one character for 1 digit month or day, e.g., May: 5 instead of 05. Still stuck...but I liked learning the Filter function - very cool! Any other possible solutions? |
![]() |
| Thread Tools | |
| Display Modes | |
| |