[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is converting string to integer possible?
Jerry writes:
> Hi
>
> I have 2 text columns VARCHAR 50 and I put a date in them in format
>
> yyyymmddhhmmss
MySQL does have a DATETIME type, which would probably be better
suited to your needs.
> Is there a way to force string to be read as interger (same as CINT in
> VBScript, but I need to to this in mySQL).
Yes, string_expression+0 will be an integer. It's not pretty, but it
works.
//C
--
Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280
carl@xxxxxxxxxx | http://pixelmagic.dyndns.org/~cirdan/
Amiga user since '89, and damned proud of it too.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <mysql-thread92325@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
This mailing list archive is a service of Copilot Consulting.