Q
am 18.04.2005 09:58:07 von gorostasREMOVE_THIS
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.
Q
am 18.04.2005 10:01:02 von gorostasREMOVE_THIS
sorry for typo, only those whitch are not 1
"gorostas" wrote:
> 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.
Re: Q
am 18.04.2005 13:21:24 von reb01501
gorostas wrote:
> sorry for typo, only those whitch are not 1
>
> "gorostas" wrote:
>
>> 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
>>
>> 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!
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
--
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"
Re: Q
am 28.04.2005 13:20:04 von NeilS
Forgive my ignorance, MVP, but shouldn't there be a WHERE clause in there
somewhere?
"Bob Barrows [MVP]" wrote:
> gorostas wrote:
> > sorry for typo, only those whitch are not 1
> >
> > "gorostas" wrote:
> >
> >> 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
> >>
> >> 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!
>
> 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
>
> --
> 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"
>
>
>
Re: Q
am 28.04.2005 14:14:28 von reb01501
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
NeilS wrote:
> Forgive my ignorance, MVP, but shouldn't there be a WHERE clause in
> there somewhere?
>
> "Bob Barrows [MVP]" wrote:
>
>> gorostas wrote:
>>> sorry for typo, only those whitch are not 1
>>>
>>> "gorostas" wrote:
>>>
>>>> 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
>>>>
>>>> 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!
>>
>> 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
>>
>> --
>> 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"
--
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.