[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is converting string to integer possible?
>> 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.
Hm, yes, but I have a forum set to this variable type (Snitz forum also has
with VARCHAR not DATETIME). More compatible across different time formats I
think.
>> 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.
Hm, doesn't work :-(
What is wrong here:
SQLstmt = "SELECT r_date+0 as date, count(*) as count"
SQLStmt = SQLstmt & "FROM forum_reply "
SQLStmt = SQLStmt & " WHERE topic_ID =" & topic_ID & " AND date < " &
session("date")
Session("date") holds 20011126121222
Is 14 number digit to much to use < or what is wrong?
Thank you for your help.
Yours
Jerry
---------------------------------------------------------------------
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-thread92327@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.