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);
|
|
|
|