tonyblazek
Technical User
Hello all, a guy who knows nothing about SQL here. I built a query in Access and I would like to modify it so if one or more of the values is null it is replaced with a wild card. Following is the SQL generated by my Access query,
SELECT Asset.[Asset ID], Asset.Name, Asset.Description, Asset.Location, Asset.Process, Asset.Function, Asset.Type
FROM Asset
WHERE (((Asset.Process)=[Forms]![Asset_PFT]![PFT_Process]) AND ((Asset.Function)=[Forms]![Asset_PFT]![PFT_Function]) AND ((Asset.Type)=[Forms]![Asset_PFT]![PFT_Type]));
I got out my SQL book and added the isnull(see below) but it doesn't work?
SELECT Asset.[Asset ID], Asset.Name, Asset.Description, Asset.Location, Asset.Process, Asset.Function, Asset.Type
FROM Asset
WHERE (((Asset.Process)=[Forms]![Asset_PFT]![PFT_Process]) AND ((Asset.Function)=[Forms]![Asset_PFT]![PFT_Function]) AND ((Asset.Type)=[Forms]![Asset_PFT]![PFT_Type]) AND (( isnull(Asset.Process, "*" AND ((isnull(Asset.Function, "*" AND ((isnull(Asset.Type, "*"
Where did I go wrong? Thanks, Tony
SELECT Asset.[Asset ID], Asset.Name, Asset.Description, Asset.Location, Asset.Process, Asset.Function, Asset.Type
FROM Asset
WHERE (((Asset.Process)=[Forms]![Asset_PFT]![PFT_Process]) AND ((Asset.Function)=[Forms]![Asset_PFT]![PFT_Function]) AND ((Asset.Type)=[Forms]![Asset_PFT]![PFT_Type]));
I got out my SQL book and added the isnull(see below) but it doesn't work?
SELECT Asset.[Asset ID], Asset.Name, Asset.Description, Asset.Location, Asset.Process, Asset.Function, Asset.Type
FROM Asset
WHERE (((Asset.Process)=[Forms]![Asset_PFT]![PFT_Process]) AND ((Asset.Function)=[Forms]![Asset_PFT]![PFT_Function]) AND ((Asset.Type)=[Forms]![Asset_PFT]![PFT_Type]) AND (( isnull(Asset.Process, "*" AND ((isnull(Asset.Function, "*" AND ((isnull(Asset.Type, "*"
Where did I go wrong? Thanks, Tony