简体   繁体   中英

An expression of non-boolean type specified in a context where a condition is expected, near ')'

select * from srs_sce
left join sits..srs_cbo as cbostart 
       on cbostart.cboayrc = scj_ayrc and 
          cbostart.cbo_crsc = scj_crsc and 
          cbostart.cbo_blok = scj_blok and 
          cbostart.cbo_occl = scj_occl 
left join ins_ayr on ayr_code = scj_ayrc
where isnull(scj_hesd,
             isnull(cbostart.cbo_begd,
                    **convert(varchar,year(ayr_begd))+'-10-01'))**

My code is above I have a problem with the convert I am trying to convert an int and then a varchar. Can anyone help please?

The problem is the where clause - you are giving it an expression that will evaluate to a string expression, but the where clause is used to specify conditions that must be satisfied to return records.

You need to rewrite the where clause to specify records to be selected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM