Function taking long time to return value
Dear All
I have function which is taking very long to return value while running it's queries run very quickly. For example function is taking more than 10 minutes to return value while queries show all records in less than a minute. Code is attached for clarification.