Connecting Tech Pros Worldwide Help | Site Map

what is wrong with this statement

CTG
Guest
 
Posts: n/a
#1: Sep 10 '07
"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,

floronDBA
Guest
 
Posts: n/a
#2: Sep 10 '07

re: what is wrong with this statement


On 10 sep, 08:13, CTG <BadMul...@gmail.comwrote:
Quote:
"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

'69 Camaro
Guest
 
Posts: n/a
#3: Sep 10 '07

re: what is wrong with this statement


Hi.
Quote:
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.


'69 Camaro
Guest
 
Posts: n/a
#4: Sep 10 '07

re: what is wrong with this statement


Hi.
Quote:
"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.


CTG
Guest
 
Posts: n/a
#5: Sep 11 '07

re: what is wrong with this statement


On Sep 10, 5:56 pm, "'69 Camaro" <ForwardZERO_SPAM.To.
69Cam...@Spameater.orgZERO_SPAMwrote:
Quote:
Hi.
>
Quote:
"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.


Larry Linson
Guest
 
Posts: n/a
#6: Sep 11 '07

re: what is wrong with this statement


"CTG" <BadMullah@gmail.comwrote
Quote:
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.
Quote:
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


DavidB
Guest
 
Posts: n/a
#7: Sep 11 '07

re: what is wrong with this statement


On Sep 10, 2:13 am, CTG <BadMul...@gmail.comwrote:
Quote:
"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.

Closed Thread


Similar Microsoft Access / VBA bytes