Solved

Excel Parameter Query from Cells with Null Values

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
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 demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

856 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