Focal Point
[SHARING] Maintain: Best practices timestamp data type

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/995103662

October 13, 2009, 04:38 PM
brjohnson
[SHARING] Maintain: Best practices timestamp data type
I have a maintain application that connects to an MS-SQL database. The user has requested that a timestamp be added to certain records when they are inserted or updated. I'd like to see what other developers are using to generate timestamps, and what data type they are using on the back end. I could use things like the today2() function, but wouldn't this result in an alpha type field? I want to use something that could make reporting simpler in the future, and would allow me to make use of the many reporting functions for times and dates.

I've searched for documentation on this but all I can find is info referring to reporting off of timestamps or converting, but nothing about generating them. Any advice to point me in the right direction would be appreciated.

This message has been edited. Last edited by: Kerry,


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
October 13, 2009, 05:09 PM
Waz
Would it be easier to set up a trigger on the table to add in the timestamp ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

October 13, 2009, 06:05 PM
brjohnson
Yeah, I'm not sure why I didn't explore that first. Thanks!


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
October 14, 2009, 04:06 AM
GamP
And if that is not an option, you could just use the HGETC function to populate a date-time field with the current date and time and then store it in the database.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
October 14, 2009, 11:34 AM
Alan B
I prefer HGETC every time. It is not DB specific, and leaves me in control.


Alan.
WF 7.705/8.007