Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 9th, 2007, 01:02 PM
Authorized User
Points: 292, Level: 5
Points: 292, Level: 5 Points: 292, Level: 5 Points: 292, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access Database & Null Values

Hi,

I'm using Access 2000 and .asp. In my database a field called "complete" has 3 possible values, "Yes" "Reported" and the other (the default) is empty.

I cannot get my sql to work properly. If I use "<> Yes" I only get the entries with "Reported" in them.

What I want to be returned is everything that is still empty. Any ideas....THANKS!!!
  #2 (permalink)  
Old January 9th, 2007, 02:25 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Is it empty or is it null? (They are 2 different things).

If it is an empty string you could do:

SELECT ... WHERE complete in('Reported', '')

or if it is null

SELECT ... WHERE complete = 'Reported' and complete is null

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
  #3 (permalink)  
Old January 9th, 2007, 04:11 PM
Authorized User
Points: 292, Level: 5
Points: 292, Level: 5 Points: 292, Level: 5 Points: 292, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The field actually by default is empty.

I need only the records that are still empty to pull for my search query, not the ones with "Yes" or "Reported".

I can't get Access to accept just a blank in the SQL statement, do I need to surround it by quotes or parantheses?

THANKS soooo much!
  #4 (permalink)  
Old January 9th, 2007, 04:14 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Might be a long shot (I havent used access for over a decade) but you can try this:

SELECT .... WHERE Complete not in ('Reported','Yes')

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
  #5 (permalink)  
Old January 9th, 2007, 09:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If by "empty" you mean Null, then you could use:
Code:
SELECT ... WHERE Complete<>'Yes' OR Complete IS NULL
I am a loud man with a very large hat. This means I am in charge


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access .mdb & .ldb database corrupted faisal573 Access 17 December 6th, 2017 04:38 AM
Excel 2007 & Access Database Link KennethMungwira Excel VBA 0 October 22nd, 2007 08:26 AM
Null values jmcgranahan BOOK: Access 2003 VBA Programmer's Reference 0 August 29th, 2006 02:25 PM
Outputing Null values. Neal XSLT 2 July 25th, 2006 05:46 AM
null values for properties polofson .NET Framework 2.0 1 April 23rd, 2006 05:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.