ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Null Parameter (https://www.excelbanter.com/excel-programming/446600-null-parameter.html)

gtait1

Null Parameter
 
Hi,

I have been looking everywhere for an answer to my problem but non that I can find seem to be working.

I am pulling a database from a hiring software using MS query. It has a list of different items we hire out, which I have narrowed down using a parameter on the category field. I now want to narrow it further using the name, which is fine however I need it to still give all the results of the category if the parameter is left blank. All the answers I have seen for the same problem and I dont totally understand SQL so would ideally like to get the desired results using the criterea. Although any answer would be usefull!

Vacuum Sealed

Null Parameter
 
On 19/07/2012 2:11 AM, gtait1 wrote:
Hi,

I have been looking everywhere for an answer to my problem but non that
I can find seem to be working.

I am pulling a database from a hiring software using MS query. It has a
list of different items we hire out, which I have narrowed down using a
parameter on the category field. I now want to narrow it further using
the name, which is fine however I need it to still give all the results
of the category if the parameter is left blank. All the answers I have
seen for the same problem and I dont totally understand SQL so would
ideally like to get the desired results using the criterea. Although any
answer would be usefull!




Hi

Just to clarify, this is an Excel NG...

That said, if you are importing data from a database into a workbook
then maybe you can share with us what code(s) you are currently using so
we can get a better picture...

Cheers
Mick.


gtait1

Quote:

Originally Posted by Vacuum Sealed (Post 1603803)
On 19/07/2012 2:11 AM, gtait1 wrote:[color=blue][i]
Hi

Just to clarify, this is an Excel NG...

That said, if you are importing data from a database into a workbook
then maybe you can share with us what code(s) you are currently using so
we can get a better picture...

Cheers
Mick.

Hi Mick,

What is an Excel NG? Also I am not sure what codes would be helpful to see this is the sql statemet if this helps;

SELECT resource_0.resourceID, resource_0.generic, resource_0.productcode, resource_0.department, resource_0.category, resource_0.subcategory1, resource_0.name, resource_0.description, resource_0.nominalcode, resource_0.serialnumber, resource_0.barcode, resource_0.purchaseprice, resource_0.purchasedate, resource_0.purchaseauthorisationnumber, resource_0.notes, resource_0.jobID

What I was really wanting was just a statement to put in the criterea of a query so that when a parameter field is left empty it shows all the results instead of limiting it to what you have but in the field.

Thanks


All times are GMT +1. The time now is 08:43 AM.

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