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
 Combine Two Column Value
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

immad
Posting Yak Master

Pakistan
218 Posts

Posted - 05/09/2013 :  07:31:40  Show Profile  Reply with Quote
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

Edited by - immad on 05/09/2013 07:33:55

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 05/09/2013 :  07:35:07  Show Profile  Reply with Quote
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

Pakistan
218 Posts

Posted - 05/09/2013 :  07:45:30  Show Profile  Reply with Quote
date column is OdbcType.DateTime

and time column is OdbcType.Char

immad uddin ahmed

Edited by - immad on 05/09/2013 07:47:04
Go to Top of Page

MIK_2008
Flowing Fount of Yak Knowledge

Pakistan
1050 Posts

Posted - 05/09/2013 :  07:55:13  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 05/09/2013 :  07:57:30  Show Profile  Reply with Quote
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

Pakistan
218 Posts

Posted - 05/09/2013 :  08:30:57  Show Profile  Reply with Quote
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

Edited by - immad on 05/09/2013 08:39:56
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 05/10/2013 :  00:17:08  Show Profile  Reply with Quote
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

Pakistan
218 Posts

Posted - 05/13/2013 :  03:33:08  Show Profile  Reply with Quote
Thank you my Problem is solve :)

immad uddin ahmed
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 05/13/2013 :  04:27:39  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
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.05 seconds. Powered By: Snitz Forums 2000