Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

500 points - SQL Help...

Posted on 2007-11-30
4
Medium Priority
?
151 Views
Last Modified: 2010-03-20
0
Comment
Question by:Mike Eghtebas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20383994
Are you sure that none of your string values inserted in your query are free of an apostrophe?  It would only take one to make everything crash....

Replace(fieldValue,"'","''")

When compiling your SQL string any string values with the character --> '  
must be doubled up -->  ''   <-- two apostrophizes
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 20384221
Hi Rick_Rickards,

As it is stated in the original question, the submitted SQL works just fine without Where clause. So, all those Replace(fieldValue,"'","''")  etc. are fine.

Mike
0
 
LVL 16

Accepted Solution

by:
Rick_Rickards earned 80 total points
ID: 20384274
If the code snippet below does not work below can you run the following code....

Debug.print " Where ((tEmails.SentOn <> #" & .SentOn & "#) and (tEmails.SenderInitials <> '" & strInitials & "'));"

and then post what it says.  The answer is no doubt in there.
" Where ((tEmails.SentOn <> #" & CDate(.SentOn) & "#) and (tEmails.SenderInitials <> '" & Replace(strInitials,"'","''") & "'));"

Open in new window

0
 
LVL 1

Expert Comment

by:modus_operandi
ID: 20437923
Forced accept.

modus_operandi
EE Moderator
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question