Purpose

D

Dale

I am working with a database and it does the following query

update [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Weeknumber is a number field. What is this doing?
 
B

Bob Barrows

Dale said:
I am working with a database and it does the following query

update [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Weeknumber is a number field. What is this doing?

It's generating an error message as written.

Now if it said:

update [giant eagle weekly data]
SET [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Then the result might depend on if there was an open form with the name
"giant eagle weekly data" containing a control named "weeknumber".

If such an open form existed, then it MIGHT set the weeknumber field in
all the records to the value contained by that "weeknumber" control. Or
it might raise an error about ambiguous object names. I'm not sure about
this and I have better things to do than go test it.

If no such form existed, then the query would set the weeknumber in each
field to the value already contained in the field ... essentially doing
nothing.
 
D

Dale

Bob,

Thanks. Yes i did forget to type the table name and the set in the example.
There is not forms in the database so I guess this is doing nothing then.

Dale

Bob Barrows said:
Dale said:
I am working with a database and it does the following query

update [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Weeknumber is a number field. What is this doing?

It's generating an error message as written.

Now if it said:

update [giant eagle weekly data]
SET [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Then the result might depend on if there was an open form with the name
"giant eagle weekly data" containing a control named "weeknumber".

If such an open form existed, then it MIGHT set the weeknumber field in
all the records to the value contained by that "weeknumber" control. Or
it might raise an error about ambiguous object names. I'm not sure about
this and I have better things to do than go test it.

If no such form existed, then the query would set the weeknumber in each
field to the value already contained in the field ... essentially doing
nothing.
 
J

John Spencer MVP

Well, I would expect it to do nothing but set the value of the weeknumber
field to itself. In other words, that appears to be a useless operation.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Bob,

Thanks. Yes i did forget to type the table name and the set in the example.
There is not forms in the database so I guess this is doing nothing then.

Dale

Bob Barrows said:
Dale said:
I am working with a database and it does the following query

update [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Weeknumber is a number field. What is this doing?
It's generating an error message as written.

Now if it said:

update [giant eagle weekly data]
SET [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Then the result might depend on if there was an open form with the name
"giant eagle weekly data" containing a control named "weeknumber".

If such an open form existed, then it MIGHT set the weeknumber field in
all the records to the value contained by that "weeknumber" control. Or
it might raise an error about ambiguous object names. I'm not sure about
this and I have better things to do than go test it.

If no such form existed, then the query would set the weeknumber in each
field to the value already contained in the field ... essentially doing
nothing.
 
M

Marshall Barton

Dale said:
I am working with a database and it does the following query

update [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Weeknumber is a number field. What is this doing?


As posted, that is not a legal query. To be legal, at least
would need to be:

update [giant eagle weekly data]
SET [giant eagle weekly data].weeknumber = [giant eagle
weekly data]!weeknumber

Which makes no sense because it would just waste time
setting the field to itself. You should explain what the
query is supposed to accomplish so we have a chance to
figure out how it should be written.

In the future, when you post a query (or VBA code or text
box expression), use Copy/Paste so we don't have to go back
and forth discussing typos introduced by retyping the query.
 
J

John W. Vinson

I am working with a database and it does the following query

update [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Weeknumber is a number field. What is this doing?

Nothing, because it's invalid SQL syntax. I have no idea what it's intended to
be doing - it looks like it's trying to set the value of the weeknumber field
to itself, which does nothing at all.
 
B

Bob Barrows

John said:
I am working with a database and it does the following query

update [giant eagle weekly data].weeknumber = [giant eagle weekly
data]!weeknumber

Weeknumber is a number field. What is this doing?

Nothing, because it's invalid SQL syntax. I have no idea what it's
intended to be doing - it looks like it's trying to set the value of
the weeknumber field to itself, which does nothing at all.

.... except waste time and cpu ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Week 1
Matching Dates 18
Weeknumbers 4
Unable To Count Null Date Field 2
First day of week????? 9
Filtering by week 2
Newbie Access Programer 1
Secondary Sort for Union Query? 2

Top