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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get data from a database based on a feild that is empty?

Status
Not open for further replies.

trc

MIS
Nov 27, 2000
126
CA
What I am trying to do is print the info first that has a picture associated with it. Then I want to print the info that has no image. I have not figured it out yet. Any suggestions?

Here is some of the code.

&quot;do while (recProducts.EOF = false and recProducts(&quot;PICTUREURL&quot;)<>&quot;&quot;)'Do for all items that have an image&quot;

Based on this I can refrain from printing the data where there is no image.

Here is some of the the code that I tried to print the info that has no image.

&quot;if ((recProducts(&quot;PICTUREURL&quot;).ActualSize = 0)) then ...&quot;

&quot;if ((recProducts.Fields.Item(&quot;PICTUREURL&quot;).value)=&quot;&quot;) then ...&quot;


 
Try this:

while not recProducts.EOF
if trim(recProducts(&quot;PICTUREURL&quot;))<>&quot;&quot; then
' do your stuff
end if
recProducts.movenext
wend


br
Gerard
 
Thanks I appreciate the effort but that prints the entire record set out again. What I am trying to do is print out only those records that that have no image.

so it should look something like

while not recProducts.EOF

if trim(recProducts(&quot;PICTUREURL&quot;))=&quot;&quot; then
blah blah blah


This does not work though.

Thanks.

Trevor
 
does the database recieve null values as default?

if so, then you might want to try something like

while not RS.EOF
if isNull(RS(&quot;fieldName&quot;)) then
response.write &quot;blank field&quot;
end if
RS.Movenext
wend

I forgot if you want to use IsNull or IsEmpty in the conditional... try both and see how it goes.

good luck
leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top