If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MyODBC & ADO

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-19-04, 07:32
spol spol is offline
Registered User
 
Join Date: Jun 2004
Posts: 12
Question 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
Reply With Quote
  #2 (permalink)  
Old 07-19-04, 15:43
rolandpish rolandpish is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 07-20-04, 07:50
spol spol is offline
Registered User
 
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!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On