date and time functions not working

Hello,

Date and time functions are not working for me when using the ODBC connector with LabVIEW. The following query works fine on the command line client on the server:

SELECT measurement_id, measurement_time, year(measurement_time) FROM measurements WHERE measurement_id = 84;

with the following result:

+----------------+---------------------+-------------------- ----+
| measurement_id | measurement_time | year(measurement_time) |
+----------------+---------------------+-------------------- ----+
| 84 | 2010-01-08 15:35:25 | 2010 |
+----------------+---------------------+-------------------- ----+
1 row in set (0.00 sec)

When going through the MySQL ODBC connector I get no value returned for the YEAR function:

Value -> 84.000E+0
Value -> 08/01/2010 3:35:25 PM

Other seemingly simple queries don't work either: "SELECT 3" for example.

--
Chris Purves

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc [at] m.gmane.org
Chris Purves [ Fr, 04 März 2011 21:10 ] [ ID #2056178 ]

Re: date and time functions not working

On 2011-03-04 15:10, Chris Purves wrote:
> Hello,
>
> Date and time functions are not working for me when using the ODBC connector with LabVIEW. The following query works fine on the command line client on the server:
>
> SELECT measurement_id, measurement_time, year(measurement_time) FROM measurements WHERE measurement_id = 84;
>
> with the following result:
>
> +----------------+---------------------+-------------------- ----+
> | measurement_id | measurement_time | year(measurement_time) |
> +----------------+---------------------+-------------------- ----+
> | 84 | 2010-01-08 15:35:25 | 2010 |
> +----------------+---------------------+-------------------- ----+
> 1 row in set (0.00 sec)
>
> When going through the MySQL ODBC connector I get no value returned for the YEAR function:
>
> Value -> 84.000E+0
> Value -> 08/01/2010 3:35:25 PM
>
> Other seemingly simple queries don't work either: "SELECT 3" for example.
>

I was able to solve the problem by enabling the option "Treat BIGINT columns as INT columns". I don't know if this was a problem with the ODBC connector or with the LabVIEW SQL functions, but it's working now.

--
Chris Purves

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc [at] m.gmane.org
Chris Purves [ Mo, 07 März 2011 18:17 ] [ ID #2056255 ]
Datenbanken » gmane.comp.db.mysql.odbc » date and time functions not working

Vorheriges Thema: confirm subscribe to myodbc@lists.mysql.com
Nächstes Thema: Few records return from ODBC connection of MySQL