Write SQL for a Field Name with spaces

How can I write a SQL statement for a Table field's name wiht a space.
For example
Table:=User
"User Name", "User ID", ... ect.

SQL Statement
Select * From User Order by User.User?IO

ysimonAsked:
Who is Participating?
 
Ronald BusterConnect With a Mentor OwnerCommented:
Hi simon,

try this

Select * From User
Order by "User ID"


regards,

cono




0
 
rwilson032697Commented:
Try:

Select * From User Order by "User.User IO"

Cheers,

Raymond.
 
0
 
SuperSyCommented:
Simon;

We are getting a notification e-mail about "comment added" from EE for <YSun@sci-s.com>, and I assume you are not getting the notification because of this.  

I personally want to forward the notifications to you, but alas I do not know your e-mail address, so here I am.  

I advise you to change the e-mail address in the profile setting in EE, so that you can get your notifications promptly.  

Thanks.

Sy@SCI
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
ysimonAuthor Commented:
In Delphi 4, it doesn't work. Anyone knows?
0
 
rwilson032697Commented:
Well, you could also try:

Select * From User Order by User."User IO"

or

Select * From User Order by User.[User ID]   The access way!

Cheers,

Raymond
0
 
SuperSyCommented:
Simon;

We are getting a notification e-mail about "comment added" from EE for <YSun@sci-s.com>, and I assume you are not getting the notification because of this.  

I personally want to forward the notifications to you, but alas I do not know your e-mail address, so here I am.  

I advise you to change the e-mail address in the profile setting in EE, so that you can get your notifications promptly.  

If there is nothing you can do from your side, we can try to talk with the EE administration to find out why this is happening.  I at least hope you are getting the notification in a timely fashion.

Sincerely,


SuperSy
SYamaguchi@SCI-s.com

0
 
TalkingDogCommented:
You can refer to a field with spaces (or a fieldname which is a reserved word) like this: Select [Nick Name] from ...
0
 
TalkingDogCommented:
TalkingDog changed the proposed answer to a comment
0
 
simonetCommented:
>Select * From User Order by User.[User ID]  

That also works with SQL Server. Once more, Microsoft introduces its own standards! Why don't they use " " like everybody else?

Alex
0
 
AttarSoftwareCommented:
Heh, you can call the DB to get back the delimiters with an SQL call (I will look it up for you if you need it), but of course, much in the way this thread is going, the call fails with MS Access!!  Woo hoo...  Sooooooo...  what you can do, is try the call, and if it fails, then use '[' and ']', as you know (or pretty much guess) that you are on access... ;O)

Tim.
0
 
ysimonAuthor Commented:
[User ID] doesn't work. I am using Standard DB in Delphi 4. It is Paradox 7. Why it doesn't accept [User ID]and "User ID"?
0
 
ysimonAuthor Commented:
Adjusted points to 100
0
 
hubdogCommented:
because user is a reserved word of local sql,so you get the error message,change user.db to other name such as demo.db, then you can write sql like this
SELECT  Demo."user io" FROM  "demo.db" Demo
it will ok

good luck
hubdog
0
All Courses

From novice to tech pro — start learning today.