Dan Wareham wrote:
Hey Dan,
Thanks for the post and the code ideas. Unfortuantely I still can't get the thing to work even when trying the CONCAT and CAST functions.
As per your request, here is the details of what I have got so far:
I'm running MySQL 4.1.9 with MyODBC 3.51. The table in question is the Users table which has been setup as follows
Before I even get to a solution, here are some tips for next time.
When you post details of your setup, try to make it easy to reproduce your setup. It took me 15 minutes to get your test case running on my setup.
- use mysql's "show create table" to create a valid 'create table' statement, or ( even better ):
- use mysql's "mysqldump" to dump the contents of the table you want
- don't use DSNs - convert it to a DNS-less connection - I don't have a DSN set up for your test case
- if your test case involves data in a spreadsheet, either include the spreadsheet, or alter the code to not rely on this data
- include ALL table definitions in the query - you didn't mention the Categories table in your post ( apart from in the SQL )
- don't switch between upper and lower case. You mention a 'USERS' table, and then your code refers to 'Users'
---
Now as for the solution, I'm getting time-looking values by using the following:
select ud.UserCode, cast(ud.StartTime as char) as StartTime, cast(ud.EndTime as char) as EndTime
etc
In my previous post I think I said to use 'cast(ud.StartTime as varchar(50))', which doesn't work - I wasn't near a MySQL install, but the basic idea is right, you just have to search for 'cast' on the mysql web site to get the correct usage ( varchar isn't one of the options you can cast to ).
-- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: [EMAIL PROTECTED] website: http://www.nusconsulting.com.au
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]