473,388 Members | 1,383 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Building SQL query when table is two words...

I'm attempting to build a query that involves a table called "All
Students".

The query is simply

sqlString = "SELECT * FROM All Students"

but I get "Syntax error in FROM clause" when I try to run it. I assume
this is because my table is two words. How do I get Access to recognize
it?

Thanks,
Kevin

Nov 14 '05 #1
16 12227
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"
--
Terry Kreft

<au******@quasika.net> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I'm attempting to build a query that involves a table called "All
Students".

The query is simply

sqlString = "SELECT * FROM All Students"

but I get "Syntax error in FROM clause" when I try to run it. I assume
this is because my table is two words. How do I get Access to recognize
it?

Thanks,
Kevin

Nov 14 '05 #2
Br
Terry Kreft wrote:
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"
IMO good practice to always use square brackets around field/tables
names.
<au******@quasika.net> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I'm attempting to build a query that involves a table called "All
Students".

The query is simply

sqlString = "SELECT * FROM All Students"

but I get "Syntax error in FROM clause" when I try to run it. I
assume this is because my table is two words. How do I get Access to
recognize it?

Thanks,
Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 15 '05 #3
I would hold good practice to be to establish a naming convention you stick
to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am liable to
use.
c) use lower case for names with underscore separators for readability.

If your convention involves using square brackets at all times that's fine
but it isn't necessarily good practice.
--
Terry Kreft

"Br@dley" <br**@usenet.org> wrote in message
news:oZ******************@news-server.bigpond.net.au...
Terry Kreft wrote:
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"


IMO good practice to always use square brackets around field/tables names.
<au******@quasika.net> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I'm attempting to build a query that involves a table called "All
Students". <SNIP> Thanks,
Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Nov 15 '05 #4
Br
Terry Kreft wrote:
I would hold good practice to be to establish a naming convention you
stick to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am liable
to use.
c) use lower case for names with underscore separators for
readability.
If your convention involves using square brackets at all times that's
fine but it isn't necessarily good practice.
As I said, my opinion only.

While I agree with the above (I never use spaces) you are assuming the
developer is the one creating the table/etc whereas in real life
developers are often fixing up someone else's work and don't have the
luxury of renaming all the database objects to conform to their personal
standards.
"Br@dley" <br**@usenet.org> wrote in message
news:oZ******************@news-server.bigpond.net.au...
Terry Kreft wrote:
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"


IMO good practice to always use square brackets around field/tables
names.
<au******@quasika.net> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I'm attempting to build a query that involves a table called "All
Students". <SNIP> Thanks,
Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 15 '05 #5
I'm not assuming anything. I'm stating a short version of my own practices.

If you had spent as much time as I have fixing other peoples code you would
probably realise why it is better to espouse real good practices in code
writing/database creation rather than ones which would be irrelevant if the
work had been done properly in the first place.
--
Terry Kreft

"Br@dley" <br**@usenet.org> wrote in message
news:mK******************@news-server.bigpond.net.au...
Terry Kreft wrote:
I would hold good practice to be to establish a naming convention you
stick to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am liable
to use.
c) use lower case for names with underscore separators for
readability.
If your convention involves using square brackets at all times that's
fine but it isn't necessarily good practice.


As I said, my opinion only.

While I agree with the above (I never use spaces) you are assuming the
developer is the one creating the table/etc whereas in real life
developers are often fixing up someone else's work and don't have the
luxury of renaming all the database objects to conform to their personal
standards.
"Br@dley" <br**@usenet.org> wrote in message
news:oZ******************@news-server.bigpond.net.au...
Terry Kreft wrote:
Square brackets i.e.

sqlString = "SELECT * FROM [All Students]"

IMO good practice to always use square brackets around field/tables
names.
<au******@quasika.net> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
> I'm attempting to build a query that involves a table called "All
> Students".

<SNIP>
> Thanks,
> Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Nov 15 '05 #6
Br
Terry Kreft wrote:
I'm not assuming anything. I'm stating a short version of my own
practices.
If you had spent as much time as I have fixing other peoples code
you...
Another assumption? :)

I've 11+ years experience with Access development. More than enough to
have an idea of what I'm talking about.
would probably realise why it is better to espouse real good
practices in code writing/database creation rather than ones which
would be irrelevant if the work had been done properly in the first
place.

As I said, I agree with the implementation of standards when developing
a database.

However, I stand by my initial point. Most real world jobs that I have
been involved in no-one is there to "espouse" good practice to. The
original 'developer' (I use the term loosely as most aren't real
developers) is long gone and you've been called in to add reporting or
something. Their is usually a tight budget involved that does not allow
for the luxury of redesigning the application to conform to good
practice.
"Br@dley" <br**@usenet.org> wrote in message
news:mK******************@news-server.bigpond.net.au...
Terry Kreft wrote:
I would hold good practice to be to establish a naming convention
you stick to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am
liable to use.
c) use lower case for names with underscore separators for
readability.
If your convention involves using square brackets at all times
that's fine but it isn't necessarily good practice.
As I said, my opinion only.

While I agree with the above (I never use spaces) you are assuming
the developer is the one creating the table/etc whereas in real life
developers are often fixing up someone else's work and don't have the
luxury of renaming all the database objects to conform to their
personal standards.
"Br@dley" <br**@usenet.org> wrote in message
news:oZ******************@news-server.bigpond.net.au...
Terry Kreft wrote:
> Square brackets i.e.
>
> sqlString = "SELECT * FROM [All Students]"

IMO good practice to always use square brackets around field/tables
names.
> <au******@quasika.net> wrote in message
> news:11**********************@g49g2000cwa.googlegr oups.com...
>> I'm attempting to build a query that involves a table called "All
>> Students".
<SNIP>
>> Thanks,
>> Kevin


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 16 '05 #7

OK, you seem intent on insisting I said something that I didn't so
discussing the issue with you seems irrelevant.

BYW 11+ years, means to me you are just reaching puberty in your programming
life, so that maybe explains something I hadn't taken into account <g>.

--
Terry Kreft

"Br@dley" <br**@usenet.org> wrote in message
news:Vs******************@news-server.bigpond.net.au...
Terry Kreft wrote:
I'm not assuming anything. I'm stating a short version of my own
practices.
If you had spent as much time as I have fixing other peoples code you...


Another assumption? :)

I've 11+ years experience with Access development. More than enough to
have an idea of what I'm talking about.
would probably realise why it is better to espouse real good
practices in code writing/database creation rather than ones which
would be irrelevant if the work had been done properly in the first
place.

As I said, I agree with the implementation of standards when developing a
database.

However, I stand by my initial point. Most real world jobs that I have
been involved in no-one is there to "espouse" good practice to. The
original 'developer' (I use the term loosely as most aren't real
developers) is long gone and you've been called in to add reporting or
something. Their is usually a tight budget involved that does not allow
for the luxury of redesigning the application to conform to good practice.
"Br@dley" <br**@usenet.org> wrote in message
news:mK******************@news-server.bigpond.net.au...
Terry Kreft wrote:
I would hold good practice to be to establish a naming convention
you stick to ; in my case this would mainly be:-
a) not use spaces in table or field names.
b) stick to names which are valid on all the platforms I am
liable to use.
c) use lower case for names with underscore separators for
readability.
If your convention involves using square brackets at all times
that's fine but it isn't necessarily good practice. As I said, my opinion only.

While I agree with the above (I never use spaces) you are assuming
the developer is the one creating the table/etc whereas in real life
developers are often fixing up someone else's work and don't have the
luxury of renaming all the database objects to conform to their
personal standards.

"Br@dley" <br**@usenet.org> wrote in message
news:oZ******************@news-server.bigpond.net.au...
> Terry Kreft wrote:
>> Square brackets i.e.
>>
>> sqlString = "SELECT * FROM [All Students]"
>
> IMO good practice to always use square brackets around field/tables
> names.
>> <au******@quasika.net> wrote in message
>> news:11**********************@g49g2000cwa.googlegr oups.com...
>>> I'm attempting to build a query that involves a table called "All
>>> Students".
<SNIP>
>>> Thanks,
>>> Kevin

--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response


--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Nov 16 '05 #8
"Br@dley" <br**@usenet.org> wrote in
news:Vs******************@news-server.bigpond.net.au:
However, I stand by my initial point. Most real world jobs that I
have been involved in no-one is there to "espouse" good practice
to. The original 'developer' (I use the term loosely as most
aren't real developers) is long gone and you've been called in to
add reporting or something. Their is usually a tight budget
involved that does not allow for the luxury of redesigning the
application to conform to good practice.


On any projects where I'm brought in to add something to the work of
another "developer," part of my estimate will include a cleanup
process, which is necessary before I'll agree to take over and
support any alterations to the application. This is a non-negotiable
part of the project (and needs to happn only once).

I can't waste my time repeatedly working around bad naming
conventions, and I refuse to do so. And the client pays me to fix
the things their previous developer did wrong. If they don't want to
pay me to do that, they can hire someone else to do the job.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 17 '05 #9
Br
David W. Fenton wrote:
"Br@dley" <br**@usenet.org> wrote in
news:Vs******************@news-server.bigpond.net.au: <>
.... part of my estimate will include a cleanup
process, which is necessary before I'll agree to take over and
support any alterations to the application. This is a non-negotiable
part of the project (and needs to happn only once).
<>
If they don't want to
pay me to do that, they can hire someone else to do the job.


It's nice if you can afford that luxury.
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 17 '05 #10
"Br@dley" <br**@usenet.org> wrote in
news:zL*******************@news-server.bigpond.net.au:
David W. Fenton wrote:
"Br@dley" <br**@usenet.org> wrote in
news:Vs******************@news-server.bigpond.net.au:

<>
.... part of my estimate will include a cleanup
process, which is necessary before I'll agree to take over and
support any alterations to the application. This is a
non-negotiable part of the project (and needs to happn only
once).


<>
If they don't want to
pay me to do that, they can hire someone else to do the job.


It's nice if you can afford that luxury.


It's not a luxury. I won't punish myself by taking projects where
the clients aren't interested in doing things right. I'm *saving*
them money in the long run, and saving myself gray hairs (or any
other developer who comes along after me).

Most clients can't determine what's required or not. I just make the
reworking of the app to meet my standards a required part of the
project, not even suggesting that it is in any way optional.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 17 '05 #11
Br
David W. Fenton wrote:
"Br@dley" <br**@usenet.org> wrote in
news:zL*******************@news-server.bigpond.net.au:
David W. Fenton wrote:
"Br@dley" <br**@usenet.org> wrote in
news:Vs******************@news-server.bigpond.net.au: <>
.... part of my estimate will include a cleanup
process, which is necessary before I'll agree to take over and
support any alterations to the application. This is a
non-negotiable part of the project (and needs to happn only
once).


<>
If they don't want to
pay me to do that, they can hire someone else to do the job.


It's nice if you can afford that luxury.

It's not a luxury. I won't punish myself by taking projects where
the clients aren't interested in doing things right. I'm *saving*
them money in the long run, and saving myself gray hairs (or any
other developer who comes along after me).
Sure, but "beggars can't be choosers" all the time in business.
Most clients can't determine what's required or not.
Most know what they want and usually have tight budgets/red tape.
I just make the
reworking of the app to meet my standards a required part of the
project, not even suggesting that it is in any way optional.


I'd love to be able to do that all the time but it just isn't going to
happen :)
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 18 '05 #12
"Br@dley" <br**@usenet.org> wrote in
news:6l******************@news-server.bigpond.net.au:
David W. Fenton wrote:
"Br@dley" <br**@usenet.org> wrote in
news:zL*******************@news-server.bigpond.net.au:
David W. Fenton wrote:
"Br@dley" <br**@usenet.org> wrote in
news:Vs******************@news-server.bigpond.net.au:
<>

.... part of my estimate will include a cleanup
process, which is necessary before I'll agree to take over and
support any alterations to the application. This is a
non-negotiable part of the project (and needs to happn only
once).

<>

If they don't want to
pay me to do that, they can hire someone else to do the job.

It's nice if you can afford that luxury.
It's not a luxury. I won't punish myself by taking projects

where the clients aren't interested in doing things right. I'm *saving* them money in the long run, and saving myself gray hairs (or any
other developer who comes along after me).


Sure, but "beggars can't be choosers" all the time in business.


Well, these days, I'm something of a beggar, but it's not because
of
these kinds of things that my business is slow -- it's because
there
just isn't work out there, and the clients with work aren't paying
quickly.
Most clients can't determine what's required or not.


Most know what they want and usually have tight budgets/red tape.


If I say I cannot do B until I've done A, they have to pay for A.

Or, I could add the price of A into B and not include it in the
estimate at all.

But I'd rather be honest.

And there's also the advantage to be gotten from convincing them
that I'm concerned with long-term maintainability of their
application, that the money invested pays off in the long run by
making it easier to maintain and extend the application in the
future.

If I didn't actually believe that, I certainly wouldn't spend the
time on it.
I just make the
reworking of the app to meet my standards a required part of the
project, not even suggesting that it is in any way optional.


I'd love to be able to do that all the time but it just isn't
going to happen :)


Have you tried it? I don't find clients to be that unreasonable if
you take the time to explain to them why what you're proposing is
needed and why it benefits them in the long run.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 18 '05 #13
Br
David W. Fenton wrote:
"Br@dley" <br**@usenet.org> wrote in
news:6l******************@news-server.bigpond.net.au:
David W. Fenton wrote:
"Br@dley" <br**@usenet.org> wrote in
news:zL*******************@news-server.bigpond.net.au:

David W. Fenton wrote:
> "Br@dley" <br**@usenet.org> wrote in
> news:Vs******************@news-server.bigpond.net.au:
<>

> .... part of my estimate will include a cleanup
> process, which is necessary before I'll agree to take over and
> support any alterations to the application. This is a
> non-negotiable part of the project (and needs to happn only
> once).

<>

> If they don't want to
> pay me to do that, they can hire someone else to do the job.

It's nice if you can afford that luxury.

It's not a luxury. I won't punish myself by taking projects where
the clients aren't interested in doing things right. I'm *saving*
them money in the long run, and saving myself gray hairs (or any
other developer who comes along after me).


Sure, but "beggars can't be choosers" all the time in business.


Well, these days, I'm something of a beggar, but it's not because
of
these kinds of things that my business is slow -- it's because
there
just isn't work out there, and the clients with work aren't paying
quickly.
Most clients can't determine what's required or not.


Most know what they want and usually have tight budgets/red tape.


If I say I cannot do B until I've done A, they have to pay for A.

Or, I could add the price of A into B and not include it in the
estimate at all.

But I'd rather be honest.

And there's also the advantage to be gotten from convincing them
that I'm concerned with long-term maintainability of their
application, that the money invested pays off in the long run by
making it easier to maintain and extend the application in the
future.

If I didn't actually believe that, I certainly wouldn't spend the
time on it.
I just make the
reworking of the app to meet my standards a required part of the
project, not even suggesting that it is in any way optional.


I'd love to be able to do that all the time but it just isn't
going to happen :)


Have you tried it? I don't find clients to be that unreasonable if
you take the time to explain to them why what you're proposing is
needed and why it benefits them in the long run.


Yes, of course. I'm not saying I've never had clients who are willing to
put in the resources to properly fix the database (you gotta love the
ones who say "sure go and do whatever you think needs to be done"). I'm
just stating that there are also those that don't. Typically you list
out everything and they tend to wittle out the things they don't won't
regardless of how much you protest. If I choose not to do it they will
go to another developer whose quote is lower. Sometimes,hopefully,
starting this way will lead to a longer term relationship where they
will feel more comfortable putting more resources into redesigning badly
build apps.
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 18 '05 #14
When I read this I think I should give thanks for never having had to
deal with such situations or people.
But give thanks to whom: My Mom? Random Chance? Lauren Bacall? Mr Getz?

You use Square Brackets and you think this is Truth.
Then you find there are other solutions:

SELECT * FROM All_Students
SELECT * FROM `All Students`

And you wonder ....

Nov 18 '05 #15
lylefair wrote:
When I read this I think I should give thanks for never having had to
deal with such situations or people.
But give thanks to whom: My Mom? Random Chance? Lauren Bacall? Mr Getz?
Fortune, of course :-).

You use Square Brackets and you think this is Truth.
Then you find there are other solutions:
Horatio, you're dumbing down Shakespeare.

SELECT * FROM All_Students
SELECT * FROM `All Students`

And you wonder ....


James A. Fortune

There is more in the world than you have dreamt of in all of your
philosophies, Horatio.
-- Hamlet Act1

On a midnight train to Beverly, MA:

Overheard from an elderly passenger going to Salem:
This astrology stuff really works.
Me:
So do you believe that God put messages in the stars for us to read?
Passenger:
I don't believe in God!

(heads turn toward her)

Nov 18 '05 #16
Br
lylefair wrote:
When I read this I think I should give thanks for never having had to
deal with such situations or people.
But give thanks to whom: My Mom? Random Chance? Lauren Bacall? Mr
Getz?

You use Square Brackets and you think this is Truth.


Truth? No, IMO it's just an easy way to make all objects names work in
code when spaces have been used and it also helps the name stand out
when reading the code. As with many things in Access there is 'more than
one way to skin the cat'.

<>
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 19 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bennett Haselton | last post by:
I'm looking for a PHP tutorial that specializes in how to build sites that are based around user logins. i.e. the user logs in on the front page, and are taken to a main login page where fields on...
2
by: Stan | last post by:
Hello all, I'm looking for some hints as to how to use the results of a query in another query. I assume I'm 'thinking' wrong in how to solve this, so I'm hoping someone can clobber me and send...
22
by: Robert Brown | last post by:
suppose I have the following table: CREATE TABLE (int level, color varchar, length int, width int, height int) It has the following rows 1, "RED", 8, 10, 12 2, NULL, NULL, NULL, 20...
4
by: frizzle | last post by:
Hi there, Still building my forum. I have a certain mysql-query i just can't figure out. These are my tables (simplified): categories -> id, description forums -> id, cat_id,...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
3
by: wsox66 | last post by:
I am new to Access and need some help building a report. I have looked through previous posts on reports but none of them seem to answer my question completely. I am using Access 2003 and I have...
14
bugboy
by: bugboy | last post by:
I'm a beginner at this and am confused... I have three tables: 1. words / wordpk, word 2. definitions / definitionspk and definition 3. associations / wordpk, definitionspk 'words' holds...
2
by: kilo | last post by:
Hey.. I need someone hwo can help me making my sql table.. I have no php skills. I have payed for a php program that shoud make dictation for people that have some problems reading danish.. with...
16
by: OldBirdman | last post by:
I have tables to contain the names of the birds of the world. tGN - Genus scientific (Latin) names Key (PK) autonum Ptr->FA (FK) pointer to key in table=FA Not used in this problem...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.