query problem

Reply

Join Date: Mar 2005
Posts: 1
Reputation: Morgoth is an unknown quantity at this point 
Solved Threads: 0
Morgoth Morgoth is offline Offline
Newbie Poster

query problem

 
0
  #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:

  1. 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
  2. FROM tblMachine
  3. WHERE rgBecameAvailable IS NOT NULL
  4. 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
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: query problem

 
0
  #2
Mar 27th, 2005
can you have an IF statement in a SELECT?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC