If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Naming "timestamps"
I want to use the Now() function, which returns both the current date and
time. I need some sage advice on what to name the database field I store this value in. I could call it DateCreated, but it's more than just a "date", since it includes hour/min/sec etc., too. I could call it TimestampCreated, but it's more than just a time-stamp--it also has "date" in it! What's the Best Practice on naming such fields so that the names are not (too) misleading? Thanks! Gary |
#3
|
|||
|
|||
On Sun, 17 Oct 2004 19:42:02 -0700, "Gary Schuldt"
wrote: I want to use the Now() function, which returns both the current date and time. I need some sage advice on what to name the database field I store this value in. I could call it DateCreated, but it's more than just a "date", since it includes hour/min/sec etc., too. I could call it TimestampCreated, but it's more than just a time-stamp--it also has "date" in it! What's the Best Practice on naming such fields so that the names are not (too) misleading? I usually just call such fields Timestamp or TimestampCreated, and document it. De gustibus non disputandnum est however. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
#4
|
|||
|
|||
Thanks, Armen.
That fits with my conventions of putting the "class word" (e.g., date, time, percent, description) at the end--in this case "TS"--and the modifier--Created or Modified--preceding it. So there could be a CreatedTS and a ModifiedTS, both set using Now() in the appropriate contexts. Gary "Armen Stein" m wrote in message ... In article , says... I want to use the Now() function, which returns both the current date and time. I need some sage advice on what to name the database field I store this value in. I could call it DateCreated, but it's more than just a "date", since it includes hour/min/sec etc., too. I could call it TimestampCreated, but it's more than just a time-stamp--it also has "date" in it! What's the Best Practice on naming such fields so that the names are not (too) misleading? Thanks! Gary We call it CreateTS in our shop. I think "timestamp" can imply a date too. Doesn't really matter as long as you're consistent. -- Armen Stein Access 2003 VBA Programmer's Reference http://www.amazon.com/exec/obidos/AS...jstreettech-20 J Street Technology, Inc. Armen _@_ JStreetTech _._ com |
#5
|
|||
|
|||
Thanks, John.
Yes, I agree with "De gustibus . . . " when it's purely arbitrary; I just wanted to poll the experts, since lotsa times I have to defend my programming decisions. It seems in this case that the most defensible choice would be DateTime to characterize the type of value Now returns. So I think my names are going to be CreatedDateTime and ModifiedDateTime. If I'm just interested in the date, I can use the DateValue function on the result. Gary "John Vinson" wrote in message ... On Sun, 17 Oct 2004 19:42:02 -0700, "Gary Schuldt" wrote: I want to use the Now() function, which returns both the current date and time. I need some sage advice on what to name the database field I store this value in. I could call it DateCreated, but it's more than just a "date", since it includes hour/min/sec etc., too. I could call it TimestampCreated, but it's more than just a time-stamp--it also has "date" in it! What's the Best Practice on naming such fields so that the names are not (too) misleading? I usually just call such fields Timestamp or TimestampCreated, and document it. De gustibus non disputandnum est however. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
#6
|
|||
|
|||
On Mon, 18 Oct 2004 10:43:52 -0700, "Gary Schuldt"
wrote: It seems in this case that the most defensible choice would be DateTime to characterize the type of value Now returns. So I think my names are going to be CreatedDateTime and ModifiedDateTime. If I'm just interested in the date, I can use the DateValue function on the result. Sounds good to me! John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
#7
|
|||
|
|||
John Vinson wrote in ...
I usually just call such fields Timestamp or TimestampCreated It seems in this case that the most defensible choice would be DateTime to characterize the type of value Now returns. So I think my names are going to be CreatedDateTime and ModifiedDateTime. Sounds good to me! I try to avoid reserved words. TIMESTAMP is an ODBC reserved word and a SQL Server 'future' reserved word. I also try to avoid using data types in column names. DATETIME is a native Jet data type (and reserved word!) I think it would be fairly intuitive in context that columns named 'Created' and 'Modified' were of type DATETIME. Jamie. -- |
#8
|
|||
|
|||
I guess we could extend Jamie's idea to WhenCreated, WhenModified; I'm also
keeping track of ModifiedBy username. The more intuitive / less misleading the name, in my book, the better programming, easier maintenance. Gary "Jamie Collins" wrote in message om... John Vinson wrote in ... I usually just call such fields Timestamp or TimestampCreated It seems in this case that the most defensible choice would be DateTime to characterize the type of value Now returns. So I think my names are going to be CreatedDateTime and ModifiedDateTime. Sounds good to me! I try to avoid reserved words. TIMESTAMP is an ODBC reserved word and a SQL Server 'future' reserved word. I also try to avoid using data types in column names. DATETIME is a native Jet data type (and reserved word!) I think it would be fairly intuitive in context that columns named 'Created' and 'Modified' were of type DATETIME. Jamie. -- |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
workbook naming convention | bill | General Discussion | 4 | August 9th, 2004 12:54 AM |
editing 'refers to'" box in naming dynamic ranges | R.VENKATARAMAN | Worksheet Functions | 4 | February 13th, 2004 04:22 AM |