I see where you are coming from. but take out the IF statement. You might preselect the variables that are dependencies and create a temp table to resolve the actual query. or, simply use two queries.
Kizz -------Original Message------- From: Kevin J. Bowman Date: 06/01/05 20:40:33 To: [email protected] Subject: [php_mysql] My Second Newbie Question Please understand though my questions may seem VERY simple, I am actually trying to write code and learn MySQL at the same time. I apologize for the simplistic nature of the question. I have a Table it has the fields Project (INT) Projectname (VARCHAR) Salesname (VARCHAR) as well as many others My Query that does not work SELECT v_salesdetails.salesid,v_salesdetails.project, v_salesdetails.responsible,v_salesdetails.statusname, v_salesdetails.builder,v_salesdetails.status, v_salesdetails.buildername, IF project = '' THEN v_salesdetails.salesname ELSE v_salesdetails.projectname AS salesname END IF, v_salesdetails.employeename FROM v_salesdetails This just kicks back not working with an error 1064... Syntax problem. Please help me distinguish what I am doing wrong in my statement. Kevin The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning. Yahoo! Groups Links [Non-text portions of this message have been removed] The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php_mysql/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
