Computing.Net > Forums > Database > show all records in qery critera

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

show all records in qery critera

Reply to Message Icon

Name: Deegz
Date: June 8, 2009 at 04:51:10 Pacific
OS: Windows 2000
Subcategory: General
Comment:

I tried and have researched this puzzle but I give in. I need some professional help..

I wish to run a simple MS Access query for a list of records with an "Active" and "Closed" field. I am not the best VB guy in the world (still reading the "Dummy" book).

I tried to use IIf([Enter Status]="Active","Active",Null)or IIf([Enter Status]="Closed","Closed",Null) or IIf([Enter Status]="All",Like "[a-Z*]",Null) in the select query window. I tried the "not like" etc functions, but none seem to work.

I wish to show all records if the entry "All" is applied. It's probably really simple, but its making me bald... please aid. Thanks, Mark



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: June 8, 2009 at 06:22:17 Pacific
Reply:

If the field can contain STRING1 or STRING2 but either way you want the record, leave that criteria out of your query.


0

Response Number 2
Name: Deegz
Date: June 8, 2009 at 07:00:05 Pacific
Reply:

Sorry David, I do not understand.

I wish to be able to enter data using the [ ] in the query critera:
"Active" to show active records
"Closed" to show closed records
"All" to show all the records

The active and closed IIF formula's work, but if ALL is entered the IIF true statement seems to be ignored by MS Access


0

Response Number 3
Name: David Perry
Date: June 8, 2009 at 11:19:34 Pacific
Reply:

This is not MS Access specific.

select field from table where criteria = 'SOMETHING'

If you don't want to filter based on the contents of this field, either do not include it in the where clause ( best answer ) or set the where clause to look for any matching value such as

where field in ( 'STRING1', 'STRING2', 'STRING3' );


0

Response Number 4
Name: folderol
Date: June 8, 2009 at 23:42:02 Pacific
Reply:

This too, is not access specific, but a common method to return all is to make the field compared to itself.
Something like this in SQL

where Status = case @status when 'Active' then 'Active' when 'Closed' then 'Closed' when 'All' then Status else Null end

Which will


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: show all records in qery critera

Top 10 in Queries www.computing.net/answers/dbase/top-10-in-queries/133.html

Shortcut for new record in Access? www.computing.net/answers/dbase/shortcut-for-new-record-in-access/120.html

Combine 2 reports in SQL www.computing.net/answers/dbase/combine-2-reports-in-sql/378.html