Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / April 2005



Tip: Looking for answers? Try searching our database.

Q

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gorostas - 18 Apr 2005 08:58 GMT
Hi all,
I have one field in db as integer, and i want to retreve only those who dont
have value 1

and my query is like this:

SELECT t_firmepopis.naziv,t_firme.mjesto
FROM    t_firmepopis INNER JOIN t_firme ON
    t_firmepopis.id_firma=t_firme.ID_firma and
    t_firme.sad !=1 and
    t_firme.ID_kandidata=some number from web form
and this part != seams doesnt work!

if someone have a clue, i would be very greatfull.
by
-k.p.
gorostas - 18 Apr 2005 09:01 GMT
sorry for typo, only those whitch are not 1

> Hi all,
> I have one field in db as integer, and i want to retreve only those who dont
[quoted text clipped - 12 lines]
> by
> -k.p.
Bob Barrows [MVP] - 18 Apr 2005 12:21 GMT
> sorry for typo, only those whitch are not 1
>
>> Hi all,
>> I have one field in db as integer,

Please don't make us guess what database you are using.  Always tell us the
type and version. This information is almost always relevant.

>> and i want to retreve only those
>> who dont have value 1
[quoted text clipped - 7 lines]
>> t_firme.ID_kandidata=some number from web form
>> and this part != seams doesnt work!

In what way? "doesn't work" does not mean anything to us. Is it returning no
records? The wrong records? Raising an error?

>> if someone have a clue, i would be very greatfull.

The above query should work if you are using SQL Server, and the column is
an integer column as you said. For Access, you have to use "<>" instead of
"!=". Just like vbscript and VBA.

Bob Barrows

Signature

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

NeilS - 28 Apr 2005 12:20 GMT
Forgive my ignorance, MVP, but shouldn't there be a WHERE clause in there
somewhere?

> > sorry for typo, only those whitch are not 1
> >
[quoted text clipped - 26 lines]
>
> Bob Barrows
Bob Barrows [MVP] - 28 Apr 2005 13:14 GMT
It depends on the database. With SQL Server, all the filter conditions can
be placed in the ON clause. While it is syntactically correct, with some
joins (particularly outer joins), the answer can be affected by where the
criteria are placed. With inner joins, it makes no difference.

With Access, you are right: there should be a WHERE clause for the
non-join-related filter conditions. Access will raise an error when this is
done. I did miss mentioning that.

This is why I always say: "don't make us guess what database you are using"

Bob Barrows

> Forgive my ignorance, MVP, but shouldn't there be a WHERE clause in
> there somewhere?
[quoted text clipped - 35 lines]
>> I don't check it very often. If you must reply off-line, then remove
>> the "NO SPAM"

Signature

Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.