Results 1 to 3 of 3

Thread: MyODBC & ADO

  1. #1
    Join Date
    Jun 2004
    Posts
    12

    Question Unanswered: MyODBC & ADO

    Hi all,
    I'm using Mysql 4.0.15, MyODBC 3.51.06 and ADO 2.8. My problem is that when I retrieve data from a table with a datetime column "SELECT master.Fulldate ..." (Fulldate is the datetime column), I normally get a recordset whose first column is of adDBTimeStamp type (ado 135). As soon as I need aggregate functions as "SELECT SUBSTRING(master.Fulldate,1,13) as Fulldate ... GROUP BY Fulldate" to get hourly averages, the recordset field type change to adChar (129) and is no longer treated as a valid date. Is there a way to still get a date column's field type ?

    Thank you very much!
    Paolo Saudin

  2. #2
    Join Date
    Jun 2004
    Posts
    21
    Hi Paolo,
    I use this:

    SELECT
    CAST (SUBSTRING(master.Fulldate,1,13) as datetime) as Fulldate ... GROUP BY Fulldate


    I hope I helped,
    Roland

  3. #3
    Join Date
    Jun 2004
    Posts
    12
    Thank you very much for the hint,

    I tried both CAST() and CONVERT() functions with no success, the field type is still adChar instead of datetime. I then installed MyODBC 3.51.08 and this time the field type was adBinary (ado 128)! I tried with MySql server 4.0.20d with the same result. I'm gonna try on another machine to see what's going on

    Thank again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •