Solved

500 points - SQL Help...

Posted on 2007-11-30
4
142 Views
Last Modified: 2010-03-20
0
Comment
Question by:Mike Eghtebas
  • 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 33

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now