Why do I get incorrect syntax near ')' or ',' when I type
up vote
-1
down vote
favorite
Why do I get incorrect syntax near ')' or ',' when I type
(case
when (@Citizenship = 'FN')
then try_convert(int, 1401),'$##,###'
else format (try_convert(int, @Budget) - try_convert(int, 51764 + 13118 + 1400), '$#,###'))
I've tried adding brackets, removing them, all to no avail. I just keep getting the same message. Really appreciate any pointers.
sql
New contributor
|
show 3 more comments
up vote
-1
down vote
favorite
Why do I get incorrect syntax near ')' or ',' when I type
(case
when (@Citizenship = 'FN')
then try_convert(int, 1401),'$##,###'
else format (try_convert(int, @Budget) - try_convert(int, 51764 + 13118 + 1400), '$#,###'))
I've tried adding brackets, removing them, all to no avail. I just keep getting the same message. Really appreciate any pointers.
sql
New contributor
2
this seems just a part of a query. Add the complete query you are using. also, if you plan to use stackoverflow, start with How to Ask and Minimal, Complete, and Verifiable example. be gentle with people you are asking help to. Help them to help you
– Gian Paolo
2 days ago
then try_convert(int,1401),'$##,###' else
. Betweenthen
andelse
are three comma-separated expressions, in a place where you should have one. Looking at the rest of the statement, this should be in aformat
function, which is missing the first time.
– GolezTrol
2 days ago
Space your code out and indent it nicely, maybe even put a comment after every close bracket saying what it is closing. You'll find the mistake
– Caius Jard
2 days ago
@CaiusJard I think you miscounted. The number of parentheses is correct, and it's (in this case) not the cause of the error, although admittedly, quite often it is when you get an error like this.
– GolezTrol
2 days ago
1
I've tried adding brackets, removing them, all to no avail - coding by trial and error seldom produces a good result
– Caius Jard
2 days ago
|
show 3 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
Why do I get incorrect syntax near ')' or ',' when I type
(case
when (@Citizenship = 'FN')
then try_convert(int, 1401),'$##,###'
else format (try_convert(int, @Budget) - try_convert(int, 51764 + 13118 + 1400), '$#,###'))
I've tried adding brackets, removing them, all to no avail. I just keep getting the same message. Really appreciate any pointers.
sql
New contributor
Why do I get incorrect syntax near ')' or ',' when I type
(case
when (@Citizenship = 'FN')
then try_convert(int, 1401),'$##,###'
else format (try_convert(int, @Budget) - try_convert(int, 51764 + 13118 + 1400), '$#,###'))
I've tried adding brackets, removing them, all to no avail. I just keep getting the same message. Really appreciate any pointers.
sql
sql
New contributor
New contributor
edited 2 days ago
marc_s
565k12610921244
565k12610921244
New contributor
asked 2 days ago
Suzanne Demitor
1
1
New contributor
New contributor
2
this seems just a part of a query. Add the complete query you are using. also, if you plan to use stackoverflow, start with How to Ask and Minimal, Complete, and Verifiable example. be gentle with people you are asking help to. Help them to help you
– Gian Paolo
2 days ago
then try_convert(int,1401),'$##,###' else
. Betweenthen
andelse
are three comma-separated expressions, in a place where you should have one. Looking at the rest of the statement, this should be in aformat
function, which is missing the first time.
– GolezTrol
2 days ago
Space your code out and indent it nicely, maybe even put a comment after every close bracket saying what it is closing. You'll find the mistake
– Caius Jard
2 days ago
@CaiusJard I think you miscounted. The number of parentheses is correct, and it's (in this case) not the cause of the error, although admittedly, quite often it is when you get an error like this.
– GolezTrol
2 days ago
1
I've tried adding brackets, removing them, all to no avail - coding by trial and error seldom produces a good result
– Caius Jard
2 days ago
|
show 3 more comments
2
this seems just a part of a query. Add the complete query you are using. also, if you plan to use stackoverflow, start with How to Ask and Minimal, Complete, and Verifiable example. be gentle with people you are asking help to. Help them to help you
– Gian Paolo
2 days ago
then try_convert(int,1401),'$##,###' else
. Betweenthen
andelse
are three comma-separated expressions, in a place where you should have one. Looking at the rest of the statement, this should be in aformat
function, which is missing the first time.
– GolezTrol
2 days ago
Space your code out and indent it nicely, maybe even put a comment after every close bracket saying what it is closing. You'll find the mistake
– Caius Jard
2 days ago
@CaiusJard I think you miscounted. The number of parentheses is correct, and it's (in this case) not the cause of the error, although admittedly, quite often it is when you get an error like this.
– GolezTrol
2 days ago
1
I've tried adding brackets, removing them, all to no avail - coding by trial and error seldom produces a good result
– Caius Jard
2 days ago
2
2
this seems just a part of a query. Add the complete query you are using. also, if you plan to use stackoverflow, start with How to Ask and Minimal, Complete, and Verifiable example. be gentle with people you are asking help to. Help them to help you
– Gian Paolo
2 days ago
this seems just a part of a query. Add the complete query you are using. also, if you plan to use stackoverflow, start with How to Ask and Minimal, Complete, and Verifiable example. be gentle with people you are asking help to. Help them to help you
– Gian Paolo
2 days ago
then try_convert(int,1401),'$##,###' else
. Between then
and else
are three comma-separated expressions, in a place where you should have one. Looking at the rest of the statement, this should be in a format
function, which is missing the first time.– GolezTrol
2 days ago
then try_convert(int,1401),'$##,###' else
. Between then
and else
are three comma-separated expressions, in a place where you should have one. Looking at the rest of the statement, this should be in a format
function, which is missing the first time.– GolezTrol
2 days ago
Space your code out and indent it nicely, maybe even put a comment after every close bracket saying what it is closing. You'll find the mistake
– Caius Jard
2 days ago
Space your code out and indent it nicely, maybe even put a comment after every close bracket saying what it is closing. You'll find the mistake
– Caius Jard
2 days ago
@CaiusJard I think you miscounted. The number of parentheses is correct, and it's (in this case) not the cause of the error, although admittedly, quite often it is when you get an error like this.
– GolezTrol
2 days ago
@CaiusJard I think you miscounted. The number of parentheses is correct, and it's (in this case) not the cause of the error, although admittedly, quite often it is when you get an error like this.
– GolezTrol
2 days ago
1
1
I've tried adding brackets, removing them, all to no avail - coding by trial and error seldom produces a good result
– Caius Jard
2 days ago
I've tried adding brackets, removing them, all to no avail - coding by trial and error seldom produces a good result
– Caius Jard
2 days ago
|
show 3 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Suzanne Demitor is a new contributor. Be nice, and check out our Code of Conduct.
Suzanne Demitor is a new contributor. Be nice, and check out our Code of Conduct.
Suzanne Demitor is a new contributor. Be nice, and check out our Code of Conduct.
Suzanne Demitor is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53350140%2fwhy-do-i-get-incorrect-syntax-near-or-when-i-type%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
this seems just a part of a query. Add the complete query you are using. also, if you plan to use stackoverflow, start with How to Ask and Minimal, Complete, and Verifiable example. be gentle with people you are asking help to. Help them to help you
– Gian Paolo
2 days ago
then try_convert(int,1401),'$##,###' else
. Betweenthen
andelse
are three comma-separated expressions, in a place where you should have one. Looking at the rest of the statement, this should be in aformat
function, which is missing the first time.– GolezTrol
2 days ago
Space your code out and indent it nicely, maybe even put a comment after every close bracket saying what it is closing. You'll find the mistake
– Caius Jard
2 days ago
@CaiusJard I think you miscounted. The number of parentheses is correct, and it's (in this case) not the cause of the error, although admittedly, quite often it is when you get an error like this.
– GolezTrol
2 days ago
1
I've tried adding brackets, removing them, all to no avail - coding by trial and error seldom produces a good result
– Caius Jard
2 days ago