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
 Combine Two Column Value

Author  Topic 

immad
Posting Yak Master

230 Posts

Posted - 2013-05-09 : 07:31:40
my data is like this

date------------time
5/7/2013--------6:53
5/7/2013--------6:58

i want this data in one column like this

datetime
5/7/20136:53


can u tell me that in fox pro query how i can merge two column value in one






immad uddin ahmed

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-09 : 07:35:07
what are the datatype of columns? if varchar you can just do

SELECT [date] + [time] as [datetime]
FROM table



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

immad
Posting Yak Master

230 Posts

Posted - 2013-05-09 : 07:45:30
date column is OdbcType.DateTime

and time column is OdbcType.Char

immad uddin ahmed
Go to Top of Page

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2013-05-09 : 07:55:13
SELECT convert(datetime,CONVERT(varchar,date)+' '+time) as DateTimeColumn FROM Table

Cheers
MIK
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-09 : 07:57:30
OdbcType?? where are you trying to do this?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

immad
Posting Yak Master

230 Posts

Posted - 2013-05-09 : 08:30:57
actullay i want to select data from a fox pro database and insert into sql server 2005 .In fox pro table date and time column are not one they are tow column but in sql we have a one column for datetime.
i made a c# application that retrive data from fox pro and insert into sql server 2005

immad uddin ahmed
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-10 : 00:17:08
quote:
Originally posted by immad

actullay i want to select data from a fox pro database and insert into sql server 2005 .In fox pro table date and time column are not one they are tow column but in sql we have a one column for datetime.
i made a c# application that retrive data from fox pro and insert into sql server 2005

immad uddin ahmed


then you can do this in c# by means of simple string concatenation and then pass concatenated value in sql query

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

immad
Posting Yak Master

230 Posts

Posted - 2013-05-13 : 03:33:08
Thank you my Problem is solve :)

immad uddin ahmed
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-13 : 04:27:39
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -