Author |
Topic |
ntn104
Posting Yak Master
175 Posts |
Posted - 2012-02-29 : 13:40:45
|
how to I combine two fields with different data type? for example, field1 = decimal(7,0) and field2(date)
data sample: - FIELD1 = 1234567 - FIELD2 = 2006-04-01 i want a result for FIELD3 = 1234567060401 (where 060401 is yymmdd)
thanks, |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
X002548
Not Just a Number
15586 Posts |
|
ntn104
Posting Yak Master
175 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-02-29 : 16:07:35
|
quote: Originally posted by ntn104
I think the first option I would use since the data in application was not belong to me to format that...
Thanks,
quote: Originally posted by tkizer
Or better yet, don't do this at all. Instead format your data in your application.
Tara Kizer Microsoft MVP for Windows Server System - SQL Server http://weblogs.sqlteam.com/tarad/
Subscribe to my blog
is there amy other purpose to get data in this format other than displaying? are you using the concatenated data for something else?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
ntn104
Posting Yak Master
175 Posts |
Posted - 2012-03-09 : 13:36:29
|
Just for displaying. Thanks,
quote: Originally posted by visakh16
quote: Originally posted by ntn104
I think the first option I would use since the data in application was not belong to me to format that...
Thanks,
quote: Originally posted by tkizer
Or better yet, don't do this at all. Instead format your data in your application.
Tara Kizer Microsoft MVP for Windows Server System - SQL Server http://weblogs.sqlteam.com/tarad/
Subscribe to my blog
is there amy other purpose to get data in this format other than displaying? are you using the concatenated data for something else?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
ntn104
Posting Yak Master
175 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-09 : 21:41:40
|
quote: Originally posted by ntn104
Just for displaying. Thanks,
quote: Originally posted by visakh16
quote: Originally posted by ntn104
I think the first option I would use since the data in application was not belong to me to format that...
Thanks,
quote: Originally posted by tkizer
Or better yet, don't do this at all. Instead format your data in your application.
Tara Kizer Microsoft MVP for Windows Server System - SQL Server http://weblogs.sqlteam.com/tarad/
Subscribe to my blog
is there amy other purpose to get data in this format other than displaying? are you using the concatenated data for something else?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
then why not do it at front end?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|