Skip to main content
Inspiring
August 14, 2006
Question

What's Wrong with My "Where" Clause?

  • August 14, 2006
  • 2 replies
  • 377 views
The Where clause in this statement generated by DW works fine:

"SELECT * FROM qryGetMessages Where MemberID = " + Replace(rsShowData__MMColParam, "'", "''") + ""

However, when I add an "AND" to the Where clause, it complains:

"SELECT * FROM qryGetMessages Where MemberReplyID = 1 AND MemberID = " + Replace(rsShowData__MMColParam, "'", "''") + ""

I've tried adding "MemberReplyID = 1" to the end of the clause but to no avail. Obviously, I am missing something. Please forgive my SQL ignorance and accept my thanks for any assistance.


This topic has been closed for replies.

2 replies

Inspiring
August 14, 2006
> However, when I add an "AND" to the Where clause, it complains:

What the exact error message?

--
Regards

John Waller


jasonsAuthor
Inspiring
August 15, 2006
Thanks for your willingness to help. It turns out my problem has everything to do with ME! The query that I was selecting from didn't contain the field in my Where clause, hence it produced the error. Arrgh! Well, I'm learning.
Inspiring
August 14, 2006
What complains? DW? Your SQL server?


"jasons" <webforumsuser@macromedia.com> wrote in message
news:ebqjjl$du6$1@forums.macromedia.com...
> The Where clause in this statement generated by DW works fine:
>
> "SELECT * FROM qryGetMessages Where MemberID = " +
> Replace(rsShowData__MMColParam, "'", "''") + ""
>
> However, when I add an "AND" to the Where clause, it complains:
>
> "SELECT * FROM qryGetMessages Where MemberReplyID = 1 AND MemberID = " +
> Replace(rsShowData__MMColParam, "'", "''") + ""
>
> I've tried adding "MemberReplyID = 1" to the end of the clause but to no
> avail. Obviously, I am missing something. Please forgive my SQL
> ignorance and
> accept my thanks for any assistance.
>
>
>
>