A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Naming "timestamps"



 
 
Thread Tools Display Modes
  #1  
Old October 18th, 2004, 03:42 AM
Gary Schuldt
external usenet poster
 
Posts: n/a
Default 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  
Old October 18th, 2004, 05:12 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old October 18th, 2004, 06:35 PM
Gary Schuldt
external usenet poster
 
Posts: n/a
Default

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  
Old October 18th, 2004, 06:43 PM
Gary Schuldt
external usenet poster
 
Posts: n/a
Default

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  
Old October 18th, 2004, 11:50 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old October 19th, 2004, 02:57 PM
Jamie Collins
external usenet poster
 
Posts: n/a
Default

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  
Old October 20th, 2004, 03:34 PM
Gary Schuldt
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 11:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.