| Author |
FPSE and custom SQL query
|
|
| Tero Lehto 2005-01-19, 8:47 pm |
| I have a guestbook that's getting awful lot of spam. So I dediced to but
hidden field MODERATED and default value HIDE. Now I want to get database
results so that records with MODERATED value HIDE are not printed.
Currently this works OK:
SELECT * FROM Guestbook ORDER BY Timestamp DESC
I would like it to be
SELECT * FROM Guestbook ORDER BY Timestamp DESC WHERE MODERATED <> "HIDE" ,
but FP SE won't accept that. What am I doing wrong? I've also tried these:
WHERE MODERATED NOT "HIDE"
WHERE MODERATED =! "HIDE"
WHERE MODERATED <> 'HIDE'
... and so on.
..
--
Tero Lehto
http://lehto.net/tero/
| |
| Stefan B Rusynko 2005-01-20, 7:47 am |
| Try
SELECT * FROM Guestbook WHERE MODERATED <> "HIDE" ORDER BY Timestamp DESC
Make sure the case of MODERATED matches the DB field name
--
________________________________________
_____
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
________________________________________
_____
"Tero Lehto" <tero.lehto@gmail.com> wrote in message news:ZhDHd.860$iS2.649@reader1.news.jippii.net...
| I have a guestbook that's getting awful lot of spam. So I dediced to but
| hidden field MODERATED and default value HIDE. Now I want to get database
| results so that records with MODERATED value HIDE are not printed.
|
| Currently this works OK:
|
| SELECT * FROM Guestbook ORDER BY Timestamp DESC
|
| I would like it to be
|
| SELECT * FROM Guestbook ORDER BY Timestamp DESC WHERE MODERATED <> "HIDE" ,
|
| but FP SE won't accept that. What am I doing wrong? I've also tried these:
|
| WHERE MODERATED NOT "HIDE"
| WHERE MODERATED =! "HIDE"
| WHERE MODERATED <> 'HIDE'
|
| .. and so on.
| .
| --
| Tero Lehto
| http://lehto.net/tero/
|
|
| |
| Tero Lehto 2005-01-20, 5:51 pm |
| Stefan B Rusynko wrote:
> Try
> SELECT * FROM Guestbook WHERE MODERATED <> "HIDE" ORDER BY Timestamp
> DESC
Thanks, this solved the the problem.
It's been a while since my SQL studies. :o
--
Tero Lehto
http://lehto.net/tero/
|
|
|
|