Convert the Timestamp value to BigInt
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 67
- Joined: Mon Dec 22, 2008 4:07 am
Convert the Timestamp value to BigInt
Hi,
Can anyone please let me know how to convert the Timestamp value to BigInt. The reson is we are using the MySql as database but we need to store the milli seconds also.
For Ex: 2012-01-04 11:12:13:001 to 20120104111213001
Thanks.
Can anyone please let me know how to convert the Timestamp value to BigInt. The reson is we are using the MySql as database but we need to store the milli seconds also.
For Ex: 2012-01-04 11:12:13:001 to 20120104111213001
Thanks.
Try using convert() to remove the -,:and the space.
Something like below:
If you still face any issue cover the above within AsInteger().
Something like below:
Code: Select all
Convert("-: ","",Timestamp)
pandeeswaran
-
- Participant
- Posts: 67
- Joined: Mon Dec 22, 2008 4:07 am
-
- Participant
- Posts: 67
- Joined: Mon Dec 22, 2008 4:07 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 67
- Joined: Mon Dec 22, 2008 4:07 am
-
- Participant
- Posts: 67
- Joined: Mon Dec 22, 2008 4:07 am
-
- Participant
- Posts: 67
- Joined: Mon Dec 22, 2008 4:07 am
You have been given a solution already within this thread using Convert() to remove the punctuation from your (character) timestamp. Once converted you simply place it into a BigInt column.
Keep in mind that the maximum value an unsigned BigInt (64-bit integer) can represent is 18,446,744,073,709,551,615. This is 20 digits and would equate to 1844-67-44 07:37:09.551615 when reformatted to YYYY-MM-DD HH:NN:SS.SSSSSS. A signed BigInt could represent a maximum (positive or negative) value of half the unsigned maximum value, 19 digits in length.
Regards,
Keep in mind that the maximum value an unsigned BigInt (64-bit integer) can represent is 18,446,744,073,709,551,615. This is 20 digits and would equate to 1844-67-44 07:37:09.551615 when reformatted to YYYY-MM-DD HH:NN:SS.SSSSSS. A signed BigInt could represent a maximum (positive or negative) value of half the unsigned maximum value, 19 digits in length.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
-
- Participant
- Posts: 67
- Joined: Mon Dec 22, 2008 4:07 am
-
- Participant
- Posts: 67
- Joined: Mon Dec 22, 2008 4:07 am
That "some unknown value" is the maximum positive value that can be represented by a signed BigInt.
<a href="http://en.wikipedia.org/wiki/Integer_(c ... cience)</a>
<a href="http://en.wikipedia.org/wiki/Integer_(c ... cience)</a>
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.