Excel Parameter Query from Cells with Null Values

I have a stored procedure which accepts multiple parameters (three dates)

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

Eg:
{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
DFPITCAsked:
Who is Participating?
 
SteveConnect With a Mentor Commented:
you can add an OR statement to the query to handle NULL.

See this.
0
 
SteveCommented:
Have you tried either:

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

One of these may do it.
0
 
DFPITCAuthor Commented:
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
0
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.

All Courses

From novice to tech pro — start learning today.