You're not giving us much to go on. What does "not working" mean? Error message? No data selected?
Where did you type this formula -- into the Find/Select dialog?
If this is a procedure then where is the select statement?
In general this seems like a formula that should work, so there must be some other detail you are not mentioning that is the problem.