Ajay (or Austraind?),
You said:
The where clause is right and ... Still it fails consistently.
Well then something is wrong, so post your code (like Shailesh suggested) so that we can debug it for you.
By the way, I am currently looking for new employment -- since my current position is only temporary. Perhaps if I solve your problem for you, your employer would consider employing me (instead of you)? Just kidding
Good Luck,
Avi.