CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 DLookUp Errors

Print topic Send  topic

Author Message
Doug
Posted: 11/24/2003, 4:59 AM

Im using PHP and am having problem with the criteria section. I am assuming all I need is some well placed () or ' I just dont know where to place them. Thanks

//DLookup @72-2A90DAF2
global $DBConnection1;
global $HR_EMP;
$result = CCDLookUp('AVG((SYSDATE-EMP_DOB)/365) AS Age', TABLE1, EMP_DUTY_ID = 1 AND EMP_LNAME LIKE '%{s_EMP_LNAME}%' AND EMP_FNAME LIKE '%{s_EMP_FNAME}%' AND EMP_SAC_CODE LIKE '%{s_EMP_SAC_CODE}%', $DBConnection1);
$result = intval($result);
$HR_EMP->avg->SetValue($result);
//End DLookup

This is the line that has the problems
EMP_DUTY_ID = 1 AND EMP_LNAME LIKE '%{s_EMP_LNAME}%' AND EMP_FNAME LIKE '%{s_EMP_FNAME}%' AND EMP_SAC_CODE LIKE '%{s_EMP_SAC_CODE}%'

Doug
Posted: 11/25/2003, 6:15 AM

After playing with this for a while and making minor changes, I have realized that the lookup parameters are not being passed to the DLookUp function.

$result = CCDLookUp('AVG((SYSDATE-EMP_DOB)/365) AS Age', OEOMGR.HREMP, "(EMP_DUTY_ID = 1) AND (EMP_SAC_CODE LIKE '%{s_EMP_SAC_CODE}%')", $DBConnection1);

Anyone have any ideas of what I could do so that the DLookUp query will grab the passed value?

Thanks
Doug
Posted: 11/25/2003, 6:28 AM

Ended up getting it to work. This is what I did

$SAC_CODE = CCGetFromGet("s_EMP_SAC_CODE", "");
$result = CCDLookUp('AVG((SYSDATE-EMP_DOB)/365) AS Age', HREMP, "(EMP_DUTY_ID = 1) AND (EMP_SAC_CODE LIKE '%$SAC_CODE%')", $DBConnection1);
$result = intval($result);

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.