473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Need to INSERT blank field into my database from Excel

Hi, I am sure this should be easy but can't get it working,

I have a database which needs to import fields from a spreadsheet, I can open the spreadsheet and load the fields I want to into an INSERT INTO statement. I had an issue with a previous INSERT INTO and solved it using the NULL keyword (rather than just leaving it blank) which now works fine.

Where I get stuck is in loading up a blank value, if the field is blank in Excel it throws up an error, problem is I can't use ISNULL() or Nz() as the value is Blank and not Null.
Is there anything tike Nz that can change it from a blank field, I have tried
Expand|Select|Wrap|Line Numbers
  1. iif(.Range("A1").value = " ","Null",.Range("A1").value)
but it does not pick it up,

Any help you can give would be greatly appreciated as I have been stuck on this for a while.

I am using Access/Excel 03
Jun 17 '10 #1

✓ answered by patjones

The way you've written the condition in the IIf function, you are looking for " " which is an entry with one space. Are you sure you aren't looking for a zero-length string, "" ?

Pat

1 2688
patjones
931 Expert 512MB
The way you've written the condition in the IIf function, you are looking for " " which is an entry with one space. Are you sure you aren't looking for a zero-length string, "" ?

Pat
Jun 17 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Weyhooi | last post by:
Help ! please help! i can't find the way to insert a new blank row into excel worksheet using C#. Example macro in vb6 as below : Rows("15:15").Select Selection.Insert Shift:=xlDown i have...
3
by: Bon | last post by:
Dear all How can I convert a datetime in Short Date format to General Date format and then insert into SQL database? I get a date from a field using Request("in_date"), which is in Short...
2
by: shantanu | last post by:
Dear All My requirement is to count the number of cells which are blank in a excel column, for that i am writing the following code;;;;;;;;;;;;;;;;; private void ValidateReviewComment() {...
0
by: grego9 | last post by:
I am trying to insert a new blank row above any row in my excel spreadsheet that has the text "NO" in column O. The macro I have written (below) works fine - apart from when there are two or three...
6
by: grego9 | last post by:
I am trying to write some code to get Excel 2000 to insert a blank row wherever there is a "NO" in column O (above the NO). The code below nearly does this - but not quite!. The problem I have is...
5
by: shredder249 | last post by:
Hi, im trying to run an update SQL statement which sets the flag (queryident) to ticked if the track title field in that record is blank. However using '' to indicate a blank field does not work. Any...
6
by: ndeeley | last post by:
Hi, How do I insert a null or blank field into a database using coldfusion? I'm new to CF and its proviing a bit tricky! My database date field accepts null values (I think - theres no default...
2
chathura86
by: chathura86 | last post by:
public void insertData(String sql) { if(conn != null) { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn ; //setting the connection to sql command ...
1
by: ronakinuk | last post by:
how to insert multiple rows in excel using vba how to insert multiple rows in excel using vba how to insert multiple rows in excel using vba
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.