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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

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

Starting Member

2 Posts

Posted - 11/01/2013 :  09:54:16  Show Profile  Reply with Quote

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

Premature Yak Congratulator

22864 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


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

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  
 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