|
-
Aug 17th, 2000, 03:19 PM
#1
Thread Starter
Lively Member
Hi, this is my first posting on this site.
In VB 5 I am having a problem making an SQL query. I need to have quotes in the query but VB says there is a problem.
here is the query...
SELECT prCustomers.Num, prCustomers.Type, IIf([prCustomers]![Type] = "c",[name],"err") AS Cop, IIf([prCustomers]![Type]="i",[surname],"err") AS Ind" & _
"FROM (prCustomers LEFT JOIN prCorporate ON prCustomers.Num = prCorporate.num) LEFT JOIN prIndividual ON prCustomers.Num = prIndividual.Num"
What I need to know is how do I have the "c" without VB thinking that I am closing the string. The same with when I need a string "err" put in the query. VB gets to the first " and thinks I am closing the string.
Thanks
You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!
-
Aug 17th, 2000, 03:23 PM
#2
Monday Morning Lunatic
If you wanted to make a variable with contents:
My house is called "Thornby"
then you would use this syntax:
sMyStr = "My house is called ""Thornby"""
You need to 'escape' the quotes. Simply put two quotes, and they will appear as one.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|