Excel Parameter Query from Cells with Null Values

Posted on 2013-06-03
Medium Priority
Last Modified: 2013-07-29
I have a stored procedure which accepts multiple parameters (three dates)

I use a parameter query in excel to call this via ODBC

{CALL SP_Mystoredproc(?, ?, ?)}

This works great, I can input data in three cells and it returns the correct data.

My problem is, sometimes I wish to pass a NULL value, which I can do statically by:
{CALL SP_Mystoredproc(?, ?, NULL)}

How do i do this from an excel cell without using VB / Macros?

I've tried entering NULL into the cell, however, it just returns "invalid date" or something
Question by:DFPITC
  • 2
LVL 24

Expert Comment

ID: 39218218
Have you tried either:

1) Double quotes in the cell. [ "" ]
2) A single apostrophe [ ' ]
3) a tripple apostrophe [ ''' ]

One of these may do it.
LVL 24

Accepted Solution

Steve earned 2000 total points
ID: 39218249
you can add an OR statement to the query to handle NULL.

See this.

Author Closing Comment

ID: 39365941
I didn't have access to modify the query, so I had to create a new query that ran that query and accepted empty strings "" from excel, converting them to NULL

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Manually copying shapes and their assigned macros one by one to a new location can be tedious, but if you use the Excel utility workbook attached to this article, the process will be much quicker and easier.
What to do if a split doesn't fit? Or a bunch of invoice lines must be rounded while the sum must match a total? It takes a little, but - when done - it is extremely easy to implement.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

619 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question