Zolf
asked on
Querying Mysql using ODBC
Hello there,
I am using SSRS to create reports.the db i am using is MySQL.so I had to use ODBC connection.now in my mysql table i have a column date from which i want to remove the year,month part.but the problem is it does not like DatePart function of mssql. also when i use mysql function i get error.please help
cheers
zolf
I am using SSRS to create reports.the db i am using is MySQL.so I had to use ODBC connection.now in my mysql table i have a column date from which i want to remove the year,month part.but the problem is it does not like DatePart function of mssql. also when i use mysql function i get error.please help
cheers
zolf
please see here the list of date and time functions of MySQL:
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
ASKER
jaiganeshsrinivasan:
i want to sort the sales based on year,month.therefore for that i am trying to seperate that in the query.so i can drag and drop the year in the table and use group by.
if you know another way please help me.
Angellll:
SELECT transactions.price, transactions.state, transactions.CheckDate, transactions.BankID, products.EngName, DAYOFMONTH(transactions.Ch
AS `Day`, MONTHNAME(transactions.Che
the DAYOFMONTH function returns the day but when i use MONTHNAME i get <binarydata> instead of the month.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Angellll:
i get an error saying check syntax near (20))
SELECT transactions.price, transactions.state, transactions.CheckDate, transactions.BankID, products.EngName, DAYOFMONTH(transactions.Ch
AS `Day`, MONTHNAME(transactions.Che
`CAST`(MONTHNAME(transacti
in your group (layout --> right click on your group --> edit group)
give the expression as =Year(Fields!d1d.Value) where d1d is your datetimefield...simple
give the expression as =Year(Fields!d1d.Value) where d1d is your datetimefield...simple
there is no single quote for 'CAST' and 'CHAR' in ANGELS example...
just use CAST / CHAR...
just use CAST / CHAR...
remove the ``around CHAR and CAST
ASKER
that quote is put automactically by Visual Studio when i press execute
jaiganeshsrinivasan:
let me try your way
ASKER
jaiganeshsrinivasan:
It worked your way.
thanks everybody for your help
you can do so in reports ...
jst add the field and add an expression to it...there are various date expressions that you can use...