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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Odd date storage - BigInt

Author  Topic 

Kbalz
Yak Posting Veteran

94 Posts

Posted - 2007-12-18 : 10:02:42
I am trying to create a report based on some tables our software is populating. It has a CreateDate column, which logs when the row was inserted to the table. The CreateDate column is of BigInt type, and not datetime.

I was wondering if maybe this was a common thing to do? Or are the intentionally making it hard to decipher? Here are some sample rows, all were entered within about 4 seconds from start to finish


128424607264976018
128424607265132354
128424607265132355
128424607265132356
128424607265132357
128424607265288691
128424607265288692
128424607265445028
128424607271229497
128424607271385834
128424607297025102
128424607297494113
128424607297806787
128424607297963124
128424607298432135
128424607298744809
128424607299213820
128424607299995505
128424607302027886
128424607302184223
128424607302184224
128424607302340560
128424607318286934
128424607319224956
128424607320319315
128424607321882685
128424607322039022
128424607322039023
128424607322195359
128424607339548766
128424607339548767
128424607382854115
128424607383010452
128424607383479463
128424607388794921
128424607388951258
128424607394892064
128424607395048401
128424607404897632
128424607405053969
128424607405210306
128424607410994775
128424607411151112
128424607411151113
128424607415997559
128424607428035508
128424607449297340
128424607449453677
128424607449453678
128424607449453679
128424607455394483
128424607460397267
128424607460397268
128424607460397269
128424607460397270
128424607460553604
128424607460553605
128424607460553606
128424607460709941
128424607460709942
128424607460709943
128424607472435216
128424607472435217
128424607515740565
128424607515740566
128424607613451190
128424607613451191
128424607624394780
128424607678956393


To compare with, here are some rows from yesterday - Based on the context of the software, I'm guessing these entries were also within a few seconds.


128424533906808217
128424533906808218
128424533906964474
128424533906964475
128424533906964476
128424533907120732
128424533907120733
128424533907276990
128424533907276991
128424533907276992
128424533907276993
128424533907433248
128424533907433249
128424533907433250
128424533907433251
128424533907589506
128424533907589507
128424533907589508
128424533916808728
128424533916808729
128424533916808730
128424533916808731
128424533916964986
128424533916964987
128424533916964988
128424533916964989
128424533917121244
128424533917121245
128424533917121246
128424533917121247
128424533917277502
128424533917277503
128424533933215818
128424534051971898
128424534169634172
128424534288233994
128424534418084392


Here is one row from the first block of code (128424607678956393) vs. one from yesterday (128424534418084392).. Here is one from the day before yesterday (128424420012332500).

So the bolded numbers have incremented by one for the past week, one each day. And the first 5 digits haven't changed. I can't seem to pin anything else down. Looking to see if anyone has seen date storage in this way before, and how to read it?

I've searched the software's small community forums, and there are no discussions even mentioning the SQL Tables. I've made a post there as well.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-12-18 : 10:06:06
What do you want to compare with?
Can you post some expected result?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kbalz
Yak Posting Veteran

94 Posts

Posted - 2007-12-18 : 10:12:48
Sorry - at the end of the select statement I threw in a getdate()..

128424607678956393

is close to

2007-12-18 09:13:25.590

I'll get some more sample outputs in a few minutes
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-18 : 10:57:23
Where is the code that do the actual insert?
Maybe you can get some clues from there?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Kbalz
Yak Posting Veteran

94 Posts

Posted - 2007-12-18 : 11:04:46
I got help from their developers:

"CreationDate" is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC). It's corresponding to the FILETIME windows structure.


They also provided a dateadd function for me to work with. Thanks.
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2007-12-20 : 08:06:28
We've been here before:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=26544
Go to Top of Page
   

- Advertisement -