Solved

Excel Parameter Query from Cells with Null Values

Posted on 2013-06-03
3
325 Views
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

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
0
Comment
Question by:DFPITC
  • 2
3 Comments
 
LVL 24

Expert Comment

by:Steve
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.
0
 
LVL 24

Accepted Solution

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

See this.
0
 

Author Closing Comment

by:DFPITC
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
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now