Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 converting a date to number and concatenating

Author  Topic 

danbyr
Starting Member

2 Posts

Posted - 2013-11-01 : 09:54:16
Hi

I've converted a date field to a number. I'd then like to concatenate this with another number field.

(CONVERT(bigint,convert(datetime,[Date of Incident])) + ' ' + cast([Incident Number]as nvarchar(4))) as 'lookup'

Using the code above only returns the converted date to number field.

Any help welcomed

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2013-11-01 : 10:03:42

(CAST(CONVERT(bigint,convert(datetime,[Date of Incident])) as NVARCHAR(20)) + ' ' + cast([Incident Number]as nvarchar(4))) as lookup

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

danbyr
Starting Member

2 Posts

Posted - 2013-11-04 : 04:16:00
madhivanan - Worked perfect, thank you very much.
Go to Top of Page
   

- Advertisement -