ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If Statement in Database Query (https://www.excelbanter.com/excel-worksheet-functions/447187-if-statement-database-query.html)

pmcook1979

If Statement in Database Query
 
I have read some similar posts but couldnt find the answer to help me with the below...

I am trying to setup a query so if cells are filled in with a project title then only this data comes through the database query, if it is empty - everything comes through.

So i did:

Criteria field = Project
Value = Is Not Null
or = [Project Title]

I know this isnt the right thing to do but i cant get it to work using other attempts...

So in the spreadsheet, if A1 = blank then all projects otherwise only what A1 equals. I can do the pointing to the cell easily, its just the IF statement in the Database query i am struggling with.

pmcook1979

Quote:

Originally Posted by pmcook1979 (Post 1605723)
I have read some similar posts but couldnt find the answer to help me with the below...

I am trying to setup a query so if cells are filled in with a project title then only this data comes through the database query, if it is empty - everything comes through.

So i did:

Criteria field = Project
Value = Is Not Null
or = [Project Title]

I know this isnt the right thing to do but i cant get it to work using other attempts...

So in the spreadsheet, if A1 = blank then all projects otherwise only what A1 equals. I can do the pointing to the cell easily, its just the IF statement in the Database query i am struggling with.


Its ok - got it to work by doing:

Like [Project Title]

Then in the cell it is pointing at did an if statement there to say =if(a3="","%",a3)...

The % was the wildcard i needed.


All times are GMT +1. The time now is 01:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com