By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,794 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 IT Pros & Developers. It's quick & easy.

what is wrong with this statement

P: n/a
CTG
"update [SIM-TAB] set UPDATE-FLAG=false, UPDATE-DT= '10/09/2007
4:09:59 PM' WHERE ICCID='I1' "

UPDATE_FLAG is a YES/NO
ICCID is TEXT
I have tried YES, NO as well but still fails,

Sep 10 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On 10 sep, 08:13, CTG <BadMul...@gmail.comwrote:
"update [SIM-TAB] set UPDATE-FLAG=false, UPDATE-DT= '10/09/2007
4:09:59 PM' WHERE ICCID='I1' "

UPDATE_FLAG is a YES/NO
ICCID is TEXT
I have tried YES, NO as well but still fails,
Add more brackets, same as on [SIM-TAB]
[UPDATE-FLAG]=false, [UPDATE-DT]= '10/09/2007

Sep 10 '07 #2

P: n/a
Hi.
what is wrong with this statement
The beginning of a sentence requires an initial capitalized letter. Also,
your question requires a question mark at the end of the sentence. For
example:

"What is wrong with this statement?"

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
Sep 10 '07 #3

P: n/a
Hi.
"update [SIM-TAB] set UPDATE-FLAG=false, UPDATE-DT= '10/09/2007
4:09:59 PM' WHERE ICCID='I1' "
1.) The dash sign means "subtract the value on the right from the value on
the left." As written, your query is attempting to subtract the value of
FLAG from the value of UPDATE and then subtract the value of DT from the
value of UPDATE. There is no UPDATE column, nor FLAG column, nor DT column.
Also, the above syntax assigning values to an expression just won't work.

2.) UPDATE is a Reserved word, and Reserved words should not be used to
name columns (or any other identifier for that matter), because Jet may use
the Reserved word for its intented purpose, not the use you want to assign
to it.

3.) A date data type must be bracketed by the pound sign, #, both before
and after the date in Jet SQL. For example:

UPDATE MyTable
SET MyDate = #10/09/2007 4:09:59 PM#
WHERE MyDept = 'Accounting';

It's important to use US format dates (mm/dd/yyyy) in Jet queries.
Therefore, the above date is 9 Oct. 2007, not 10 Sept. 2007.

4.) One may either change the names of columns so that Reserved words
aren't used and illegal characters aren't used (only use alphanumeric
characters and the underscore character), or one may put brackets around the
names of the bad column names, but the latter method isn't guaranteed to
work, so it's best to avoid the problems in the first place by using
acceptable names for all identifiers.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
Sep 10 '07 #4

P: n/a
CTG
On Sep 10, 5:56 pm, "'69 Camaro" <ForwardZERO_SPAM.To.
69Cam...@Spameater.orgZERO_SPAMwrote:
Hi.
"update [SIM-TAB] set UPDATE-FLAG=false, UPDATE-DT= '10/09/2007
4:09:59 PM' WHERE ICCID='I1' "

1.) The dash sign means "subtract the value on the right from the value on
the left." As written, your query is attempting to subtract the value of
FLAG from the value of UPDATE and then subtract the value of DT from the
value of UPDATE. There is no UPDATE column, nor FLAG column, nor DT column.
Also, the above syntax assigning values to an expression just won't work.

2.) UPDATE is a Reserved word, and Reserved words should not be used to
name columns (or any other identifier for that matter), because Jet may use
the Reserved word for its intented purpose, not the use you want to assign
to it.

3.) A date data type must be bracketed by the pound sign, #, both before
and after the date in Jet SQL. For example:

UPDATE MyTable
SET MyDate = #10/09/2007 4:09:59 PM#
WHERE MyDept = 'Accounting';

It's important to use US format dates (mm/dd/yyyy) in Jet queries.
Therefore, the above date is 9 Oct. 2007, not 10 Sept. 2007.

4.) One may either change the names of columns so that Reserved words
aren't used and illegal characters aren't used (only use alphanumeric
characters and the underscore character), or one may put brackets around the
names of the bad column names, but the latter method isn't guaranteed to
work, so it's best to avoid the problems in the first place by using
acceptable names for all identifiers.

HTH.
Gunny

Seehttp://www.QBuilt.comfor all your database needs.
Seehttp://www.Access.QBuilt.comfor Microsoft Access tips and tutorials.
Blogs:http://www.DataDevilDog.BlogSpot.com...utors2.htmlfor contact
info.

THANKS to you guys for teh repoponses
I renamed teh table and fields

1-however to pinpoint the problem even this would fail, the select
statements however have no problem with it.

"UPDATE SIMTAB SET UPDFLAG=1 WHERE ICCID='I1' "

I am doing this in a C# application .

2-I have not been able to figure out how I can do thsi query by typing
command in Access to speed up the resolution to thsi problem.
Sep 10 '07 #5

P: n/a
"CTG" <Ba*******@gmail.comwrote
1-however to pinpoint the problem even this would fail, the select
statements however have no problem with it.

"UPDATE SIMTAB SET UPDFLAG=1 WHERE ICCID='I1' "

I am doing this in a C# application .
What are you doing to _execute_ the SQL? It is not, repeat NOT, just a
program statement.

In Access VBA, using Data Access Objects, it would be something like:

CurrentDB.Execute strMyQuery

where strMyQuery is a string/text variable containing the query you want to
execute.
2-I have not been able to figure out how I can do thsi query by typing
command in Access to speed up the resolution to thsi problem.
You must, of course, have access to the tables... either by testing your
query in the Jet database where the tables actually reside, or linking to
those tables -- on the File Menu, "Get External Data" and "Link" and then
follow the prompts (that's on Access 2003 or earlier... someone else would
have to tell you the details of the commands to link on Access 2007).

On the Database Window, click the Queries tab, then click "New" to open the
Query Builder. I'd suggest learning at least enough to use the Query
Builder, but with the Query open in Design View, you can click View on the
menu, choose SQL and type in the SQL directly.

Larry Linson
Microsoft Access MVP
Sep 11 '07 #6

P: n/a
On Sep 10, 2:13 am, CTG <BadMul...@gmail.comwrote:
"update [SIM-TAB] set UPDATE-FLAG=false, UPDATE-DT= '10/09/2007
4:09:59 PM' WHERE ICCID='I1' "

UPDATE_FLAG is a YES/NO
ICCID is TEXT
I have tried YES, NO as well but still fails,
What is wrong is that your naming convention is horrid. Object names
at all levels (IMHO) should never use spaces, dashes, underscores, etc.

Sep 11 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.