SQL SELECT difficulties

KevGooss

New member
Local time
Today, 08:10
Joined
Dec 27, 2000
Messages
5
I am using an SQL statement to create a temporary table that I am going to pare down based on some user criteria. My first SQL command places all of the records into the table based on a single criteria. My problem is that when I use the statement:

INSERT INTO tbltemp SELECT field1,field2,field3 FROM tbltable1 WHERE criteria1 = "pleasework"

I get only those records where fields 1,2,and 3 are all not null. I am not concerned with only the nonnulls, I would like all rows to be returned regardless of their values.
 
Try using OR in your SQL statement

WHERE criteria1 = "pleasework" or null or "X"

in above, if null doesen't work make "X" your default value for Criteria1.

Hope this Helps
 
If you want all rows returned regardless of their values, why are you using a WHERE clause? Whatever criteria you have specified in the WHERE clause is restricting the query's output.
 

Users who are viewing this thread

Back
Top Bottom