>>Hi
>>
>>I am trying to work out the code for the following
>>
>>I have 12 query fields - any or all may contain values - I only want SQL to run the query on those fields where the query field is non blank
>>
>>eg Town = New York Country = USA zipcode (blank)
>>
>>The query would only work on town and country since the zipcode field is blank
>>
>>Alternatively I might have to run a number of queries one after using the results from query 1 as the source data for query 2 - is there any way I can do this?
>>
>
>SELECT * from Address ;
> WHERE IIF(empty(?vp_city), .T., address.city = ?vp_city) ;
> AND IIF(empty(?vp_state), .T., address.state = ?vp_state) ;
> AND IIF(empty(?vp_country), .T., address.country = ?vp_country) ;
> AND IIF(empty(?vp_zipcode), .T., address.zipcode = ?vp_zipcode)
Thank you very much - have now tested Borislav's answer and it works but thanks for your reply
Colin
Specialist in Advertising, Marketing, especially Direct Marketing
I run courses in Business Management and Marketing