Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Good .asp book & Newbie Question

Status
Not open for further replies.

jma

Technical User
Apr 24, 2001
74
0
0
US
I'm looking for a good book on .asp for beginners...anyone have any rec's?

Meanwhile, I have a question that is very newbie oriented..

1. If I have a database that has some blank fields, mixed with fields that have data...how can I get it to only display the fields that have data in them?

Then sort the results alpha and display on page?

Thanks, M
 
A book I would recomend is Beginning Active Server Pages 3.0 by Wrox Press.

As for your question you would do something like the following......

sqlString = "SELECT your_field FROM your_table " &_
"WHERE your_field !='" & "" & "'" &_
"ORDER BY your_field"
set rs = connection.execute(sqlString)

(above may have errors)

this SQL statement is selecting only the records where the data is NOT EQUAL(!=) to ""(ie an empty string).
All you need to do to sort them is ORDER them by your chosen field.

hope this is of some help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top