User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 427,155 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,883 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 2533 | Replies: 1
Reply
Join Date: Mar 2005
Posts: 1
Reputation: Morgoth is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Morgoth Morgoth is offline Offline
Newbie Poster

query problem

  #1  
Mar 18th, 2005
i'm having a problem with my SQL query. i'm trying to create another column with values based on the values of the other columns and call it sTitle. Every time i try to execute my SQL statement it brings back this error:

Illegal mix of collations for operation 'concat' Error No. 1271

I can't see anything wrong with my syntax but then again i'm kinda new to this. Here's my SQL:

SELECT CONCAT(rgMake,' ',IF(rgModel='ST','',CONCAT(rgModel,' ')),IF(rgWheels='2','Two','Single'),' Wheel Roll Grinder   ',ROUND(inDiaCenter*25.4,0),IFNULL(CONCAT('/',ROUND(inDiaMax*25.4,0)),''),' mm Dia.   ',ROUND(inFace*25.4,0),' mm Roll Face') AS sTitle
FROM tblMachine
WHERE rgBecameAvailable IS NOT NULL
ORDER BY rgWheels, ROUND(inDiaCenter*25.4,0), ROUND(inFace*25.4,0)

any advice would be greatly appreciated as this problem has been very frustrating to me. thanks in advance
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2004
Posts: 732
Reputation: Phaelax is on a distinguished road 
Rep Power: 6
Solved Threads: 31
Phaelax Phaelax is offline Offline
Master Poster

Re: query problem

  #2  
Mar 27th, 2005
can you have an IF statement in a SELECT?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 8:00 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC