Reputation: 1
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?
Upvotes: 0
Views: 5473
Reputation:
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.
Upvotes: 2