Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

What's Wrong with My "Where" Clause?

Explorer ,
Aug 14, 2006 Aug 14, 2006

Copy link to clipboard

Copied

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.


TOPICS
Server side applications

Views

362
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 14, 2006 Aug 14, 2006

Copy link to clipboard

Copied

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.
>
>
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 14, 2006 Aug 14, 2006

Copy link to clipboard

Copied

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

What the exact error message?

--
Regards

John Waller


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 15, 2006 Aug 15, 2006

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines