Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
missinglct
Yak Posting Veteran
75 Posts |
Posted - 2004-09-07 : 09:49:52
|
Hi all,Store the number of seconds that have elapsed since 1/1/1970 in my db.Does anyone know if there is a way to convert those total seconds in Access to a "date" format?Fx: 1072454512 = 1/1/2004Thanks, |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-09-07 : 10:41:20
|
quote: Store the number of seconds that have elapsed since 1/1/1970 in my db.
Is that a command or a question?Are you sure your example is right?I executed this in the debug window (which should be the way to get the answer you are looking for)?dateadd("s",1072454512 ,#1/1/1970#)And got this returned:12/26/2003 4:01:52 PM which is not what you show in your example.- Jeff |
 |
|
missinglct
Yak Posting Veteran
75 Posts |
Posted - 2004-09-07 : 11:04:32
|
quote: Originally posted by jsmith8858
quote: Store the number of seconds that have elapsed since 1/1/1970 in my db.
Is that a command or a question?Are you sure your example is right?I executed this in the debug window (which should be the way to get the answer you are looking for)?dateadd("s",1072454512 ,#1/1/1970#)And got this returned:12/26/2003 4:01:52 PM which is not what you show in your example.- Jeff
Thank you so much for your help.My example is just an example to show you the format of the date I want. And you are right, it is not a correct date for those total seconds. How do I apply your code in db? ?dateadd("s",1072454512 ,#1/1/1970#)I currently have a fieldname called "Begin_date" stores total seconds for each record in my table in Accesss.Also, how do I get to the debug window???Thank you very much. |
 |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-09-07 : 11:14:18
|
i am just using a function called DateAdd. Look it up in Access help. you will be much better off if you do some research and experimentation to come to the exact solution yourself.then you just write a query of the table containing your data and create a new expression, using this function, and that will be the resulting column you need.- Jeff |
 |
|
missinglct
Yak Posting Veteran
75 Posts |
Posted - 2004-09-07 : 11:43:48
|
quote: Originally posted by jsmith8858 i am just using a function called DateAdd. Look it up in Access help. you will be much better off if you do some research and experimentation to come to the exact solution yourself.then you just write a query of the table containing your data and create a new expression, using this function, and that will be the resulting column you need.- Jeff
Thx again. I did a search for DateAdd function and I found this site. I post it here in case someone else has the same question.http://www.techonthenet.com/access/functions/date/dateadd.htm |
 |
|
|
|
|
|
|