General Question about Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is sort of a wonder why trivia question....
Why do Queries use SQL and not something like VB in expressions etc?
Is it because the database might be used on a network and the query can
access the tables on the back end easier?

I'm just learning, and I really can't find an explanation in my stack of
books.
Amy.
 
I'm not sure I understand your question fully, but you can certainly use
VB in query expressions.
For example, you can define a query field like this:
NewField: [FieldA]+[FieldB]
and it will display the sum of those two fields.
Or you can do something like this:
First2: Left([FieldZ],2)
which will display the first two characters in FieldZ.

HTH
 
Thank you for answering my question.
Okay I see what you mean, and thank you for the examples. I'm just getting
into writing my own expressions for a query.
Why I asked my original question.... I was reading that when you design a
query, Access actually writes SQL code behind the scene for the query. I
miss understood and thought the designer should write and only use SQL also
when building a query.

Thanks again, As a beginner, I'm learning something new everyday.
Amy

MacDermott said:
I'm not sure I understand your question fully, but you can certainly use
VB in query expressions.
For example, you can define a query field like this:
NewField: [FieldA]+[FieldB]
and it will display the sum of those two fields.
Or you can do something like this:
First2: Left([FieldZ],2)
which will display the first two characters in FieldZ.

HTH

AMY Z. said:
This is sort of a wonder why trivia question....
Why do Queries use SQL and not something like VB in expressions etc?
Is it because the database might be used on a network and the query can
access the tables on the back end easier?

I'm just learning, and I really can't find an explanation in my stack of
books.
Amy.
 
Not to sure, but think it has something to do with the
internet itself..........SQL can be used in webdesign etc
for tables, but not vb
-----Original Message-----
I'm not sure I understand your question fully, but you can certainly use
VB in query expressions.
For example, you can define a query field like this:
NewField: [FieldA]+[FieldB]
and it will display the sum of those two fields.
Or you can do something like this:
First2: Left([FieldZ],2)
which will display the first two characters in FieldZ.

HTH

AMY Z. said:
This is sort of a wonder why trivia question....
Why do Queries use SQL and not something like VB in expressions etc?
Is it because the database might be used on a network and the query can
access the tables on the back end easier?

I'm just learning, and I really can't find an explanation in my stack of
books.
Amy.


.
 
Why I asked my original question.... I was reading that when you design a
query, Access actually writes SQL code behind the scene for the query. I
miss understood and thought the designer should write and only use SQL also
when building a query.

SQL stands for "Structured Query Language". Relational databases use
the SQL language as a widely applicable standard (with individual
dialects) for queries; VBA (or other procedural programming languages)
can access data in tables, but that's strictly secondary. SQL is the
gold standard of languages *for the purpose of managing relational
data*. If you look at SQL/Server, DB/2, MySQL, Oracle, Visual FoxPro,
even dBase - you'll find that the SQL language is used for queries.

The Query Design window isn't "the query" - it's simply a tool which
makes it easier to build the real query, which is a SQL string.


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Thank you Mr. Vinson, I understand now.


John Vinson said:
SQL stands for "Structured Query Language". Relational databases use
the SQL language as a widely applicable standard (with individual
dialects) for queries; VBA (or other procedural programming languages)
can access data in tables, but that's strictly secondary. SQL is the
gold standard of languages *for the purpose of managing relational
data*. If you look at SQL/Server, DB/2, MySQL, Oracle, Visual FoxPro,
even dBase - you'll find that the SQL language is used for queries.

The Query Design window isn't "the query" - it's simply a tool which
makes it easier to build the real query, which is a SQL string.


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
as time is running..everyday the languages r getting easier..we are into a
phase of century where these days computer languages used by most of us is
4th generational ....SQL query can be considered same way..
at first ppl use to write queries in hard and different ways ...but now now
the name SQL has been developed as standard which is easy to understand
basically simple form of grammar with fixed rules ....even also that part
Microsoft has made it little more easier by having code written
automatically as user clicks and inputs certain value.

My suggestion if you are looking for to have your database do things you
want... get use to writting your query yourself...it wil help you later...


rene said:
Not to sure, but think it has something to do with the
internet itself..........SQL can be used in webdesign etc
for tables, but not vb
-----Original Message-----
I'm not sure I understand your question fully, but you can certainly use
VB in query expressions.
For example, you can define a query field like this:
NewField: [FieldA]+[FieldB]
and it will display the sum of those two fields.
Or you can do something like this:
First2: Left([FieldZ],2)
which will display the first two characters in FieldZ.

HTH

AMY Z. said:
This is sort of a wonder why trivia question....
Why do Queries use SQL and not something like VB in expressions etc?
Is it because the database might be used on a network and the query can
access the tables on the back end easier?

I'm just learning, and I really can't find an explanation in my stack of
books.
Amy.


.
 
Back
Top