I'm trying to create a SourceID that's the CompanySourceID '-'(just the year of a date with the format mm/dd/yyyy)'-' RefNum so it might look like this;
SourceID
asdf-2008-1234
UPDATE Docs
SET SourceID = CompanySourceID + '-' + SUBSTRING(DocDate, 7, 4) + RefNum
I get "Argument data type datetime is invalid for argument 1 of substring function."
I know the above query is probably way off. Your help would be greatly appreciated.
SourceID
asdf-2008-1234
UPDATE Docs
SET SourceID = CompanySourceID + '-' + SUBSTRING(DocDate, 7, 4) + RefNum
I get "Argument data type datetime is invalid for argument 1 of substring function."
I know the above query is probably way off. Your help would be greatly appreciated.