What about the double quotes around the emp_no? Is that doing it? Have you tried single quotes?
What is the type of emp_no column? Try using cfqueryparam (which you should use anyway): where emp_no = <cfqueryparam value="#getLocInfo.pnpocempno#" cfsqltype="cf_sql_varchar"> (if emp_no is not varchar, then use the correct cfsqltype). Dave > -----Original Message----- > From: Servando Garcia [mailto:[email protected]] > Sent: Thursday, February 12, 2009 11:12 AM > To: cf-newbie > Subject: Query returns empty when there is data > > > Hello all > Thanks in advance for the help. I have a query that returns nothing when there is data in the database. > Here is the query > > <CFQUERY datasource ="#dataMain#" name ="pnpocData"> > SELECT DISTINCT emp_Fname, emp_Lname, office_telephone,standard_e_mail_addr > from vw_Employee_data > where emp_no = "#getLocInfo.pnpocempno#" > </CFQUERY> > > I have used CFDUMP to verify that the employee number is correct in the where condition of the query. I > even used CFABORT to stop and view the query. I then copied the query after interpolation into TOAD and > ran the query as is. Worked fine > > When i use CFDUMP after the query runs pnpocData is empty. > > Any ideas? > > > Sam > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4354 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
