Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Old 12-04-2007, 10:27 AM IF Statement
Junior Talker

Posts: 3
Trades: 0
hello

i am trying to get my database so that if the number in a column = to 0 or below it will then display out of stock

so far i have got this but it wont work

=IIf([quantity]="0","out of stock")
GemmaLouise1988 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-04-2007, 10:35 AM Re: IF Statement
hamesy's Avatar
Webmaster Talker

Posts: 639
Name: Steve
Location: Birmingham, England
Trades: 0
A little more information would be useful, ie what database are you using? What language are you using? etc.

You might get a few more replies if you add more information.
__________________
Hamesy

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
hamesy is offline
Reply With Quote
View Public Profile
 
Old 12-04-2007, 10:38 AM Re: IF Statement
Junior Talker

Posts: 3
Trades: 0
i am using microsoft excel 2000
GemmaLouise1988 is offline
Reply With Quote
View Public Profile
 
Old 12-04-2007, 10:38 AM Re: IF Statement
Junior Talker

Posts: 3
Trades: 0
ooops sorry

i mean microsoft access 2000
GemmaLouise1988 is offline
Reply With Quote
View Public Profile
 
Old 12-04-2007, 03:09 PM Re: IF Statement
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
"0" is a string which != 0 (zero)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-04-2007, 06:41 PM Re: IF Statement
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
I was about to say what Chris said. If it's a number column, the db will probably do an implicit conversion to make it work, but "0" != 0.

Also, it's clear this is Access, because SQL Server supports the if statement, but not iif.

If this is for a web application, you're better off just returning quantity to the page and letting it decide what text to send down to the client.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to IF Statement
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66771 seconds with 12 queries