November 27, 2006 at 2:52 pm
I am trying to construct a SQL statement as follows:
SELECT Dataname-1, Dataname-2, Dataname-3 FROM FILE1
The dashes are presenting a problem. Is there a way around this or must I change the data names on the server? any help would be appreciated.
Thanks,
charlie
November 27, 2006 at 4:03 pm
Try bracketing [ ] like [Dataname-1]
-Sharon
November 28, 2006 at 6:05 am
Thanks Sharon....
November 28, 2006 at 7:01 am
If your field name has spaces, you would use bracketing as well like FIRST NAME would be [FIRST NAME]
November 28, 2006 at 10:21 am
If you have any control over the back-end, a far better solution is to adopt a good naming convention for all objects, tables, fields, etc.
Remove all spaces in names.
Use the CamelBack style of names, in which the first letter of each word in the object name is capitalized.
Don't use non-alphabetic characters, such as the dash, in object names.
While it is still a good practice to use brackets around names in your SQL statements, you'll find that a good naming convention will eliminate a lot of nagging little issues like the one about which you're asking.
December 4, 2006 at 9:04 am
If you are renaming them (a real pain), underscores (_) will also work as a replacement for dashes with no problems. I've used both 'CamelBack' and underscores and I think it's a matter of personal preference.
Steve
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply