Forum Moderators: coopster

Message Too Old, No Replies

14 Character Number to be stored in MySQL

         

Pico_Train

8:14 am on Nov 17, 2008 (gmt 0)

10+ Year Member



Hi there,

I have a reference number of 14 characters in this format:

20081117120045

It's basically a timestamp but not really stored that way. I have it that way because an app I am using, requires it to be like so.

If i store it as 14 character INT, it gets converted to a much smaller number.

If I store it as 14 character FLOAT, it gets stored as 2.00811e+13 which is not what I want.

I just want it stored as 20081117120045 and I would like to be able to find it relatively quickly when running a query or a search.

I am not sure VARCHAR will cut it for searching for it with a query, it might be a bit slow.

Does anybody have any recommendations for this?

dreamcatcher

8:52 am on Nov 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For fixed lengths, I would use CHAR:
[dev.mysql.com...]

dc

Pico_Train

4:56 pm on Nov 17, 2008 (gmt 0)

10+ Year Member



Thanks Dreamcatcher, sweet dreams... :-)