Posts

Showing posts from March, 2015

Date Range Challenge in sql

Image
Hi Folks, When you work in a offshore - onsite setup in IT industry and if you are fortunate :-) to be a part of the offshore team then there are many compromises that you have to make. Out of those one such is to develop your code based on some illogical limitations enforced upon you by the onsite development/dba team. That is where you improvise and learn. I am going to throw some light on one such situation I faced in my last project. But this time thankfully the onsite dba gave me some tips to go about my task. Requirement :- You are given a database that has some tables in it. However we cannot access these tables directly so we are given access to some user defined functions only. For example one such table is emp_man which looks like this: and there is udf corresponding to this i.e. ///////////////////////////////////////////////////////////////////////////////////////////// create function ufn_getempl (@hrdate datetime) returns table   as   return   select *