I have a Zcatalogue that store id of Dtml docs as part of the meta_data, then i want to iterate over it and see if at least there will be one id that equal to tday and return the value assigned to tday or else to store the value of yday to tday and return it as tday. Then my major problem is how to access the id from the Zcat_New1_Dtml_doc; The code below is giving me Error Type: NameError Error Value: global name 'id' is not defined tday=DateTime().toZone('GMT+1').strftime('%d%m%y') yday=(DateTime()-1).toZone('GMT+1').strftime('%d%m%y') for i in context.Zcat_New1_Dtml_doc(): if tday==id: return tday else: tday=yday return tday ===== Hamzat kamaldeen Ishola Dnet Systems Limited. 223 Ikorodu Road, Lagos. Nigeria. 234 1 7749381, 234 08033011305 --- If Mistake is an opportunity to see better, then it is not a problem but readiness to admit it. Sentimental decisions are not mistakes but failures !!! __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com