I think that is appropriate. I did something similar, calling my function EmptyOrNull() - except I didn't go back and review old code systematically.
Note that the function can be simplified as follows:
Function MyEmpty(txValue)
return empty(txValue) or isnull(txValue)
Note, also, that it works for any date type - that's why I renamed the variable.
>Hi,
>
>When using SQL Server and allowing NULL in empty dates I came across a small issue where EMPTY( date_field) returns .F. when the entry in date_field is NULL. And this of course breaks a lot of code where the program relied on the date field being empty. I am thinking of creating a simple function like this:
>
>Function MyEmpty
>lparameter tDate
>if empty( tDate) or isnull( tDate)
> return .T.
>else
> return .F.
>endif
>
>
>And replace everywhere in the program where I use
>
>if EMPTY( date_field )
>
>with
>
>if MyEmpty( date_field )
>
>
>Can anybody see a potential problem with the above approach? TIA.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)