SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 converting a date to number and concatenating
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

danbyr
Starting Member

2 Posts

Posted - 11/01/2013 :  09:54:16  Show Profile  Reply with Quote
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

India
22713 Posts

Posted - 11/01/2013 :  10:03:42  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote

(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 - 11/04/2013 :  04:16:00  Show Profile  Reply with Quote
madhivanan - Worked perfect, thank you very much.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000