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.










share|improve this question









New contributor




Suzanne Demitor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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. 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












  • @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















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.










share|improve this question









New contributor




Suzanne Demitor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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. 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












  • @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













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.










share|improve this question









New contributor




Suzanne Demitor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question









New contributor




Suzanne Demitor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Suzanne Demitor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago









marc_s

565k12610921244




565k12610921244






New contributor




Suzanne Demitor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









Suzanne Demitor

1




1




New contributor




Suzanne Demitor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Suzanne Demitor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Suzanne Demitor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 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. 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












  • @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




    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












  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Suzanne Demitor is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















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






























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.










 

draft saved


draft discarded


















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.















 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin