473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

help - merge datefield & timefield to datetime field in sql2000

Hello,

We have a database that as two datetime fields.
field1 has the date and field2 has the time.
I need to merge field1 & field2 into field1.

Can someone help me with this syntax?

P.S. I did not design the database.<g>

Thanks for the help

Frank
Nov 15 '05 #1
1 1429
Here is a snippet of code I used to do exactly that in an Access database.
Elements 8 and 9 in my ComputerInfo array are Date and Time respectively.
LastDate is the date-time column of a second table, but you could just as
easily write your new value back into the original date column.

// determine date and time of last touch
strComputerInfo[8] = row["CollDate"].ToString().Trim();
strComputerInfo[9] = row["CollTime"].ToString().Trim();

strComputerInfo[8] = strComputerInfo[8].Remove(strComputerInfo[8].Length -
12, 12);
strComputerInfo[9] = strComputerInfo[9].Remove(0, 11);
strComputerInfo[9] = strComputerInfo[8] + " " + strComputerInfo[9];

if (strComputerInfo[9].Length > 0)
LastDate = Convert.ToDateTime(strComputerInfo[9]);
newrow["LastDate"] = LastDate;

I hope this helps.

- carl

"Frank Rocco" <fa*****@hotmail.com> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
Hello,

We have a database that as two datetime fields.
field1 has the date and field2 has the time.
I need to merge field1 & field2 into field1.

Can someone help me with this syntax?

P.S. I did not design the database.<g>

Thanks for the help

Frank

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: KS | last post by:
Hi, We are trying to do mail merge (Word 2000) from a SQL2000 server in a network environment. We has built a Web base Visual.Net project (C#) to query the SQL2000 database and format into a...
1
by: ronald.santos | last post by:
Hello, I'm trying to create a report that would show the time difference. Is it possible to make a report like this? Name Date Mode Time John 09/27/05 In ...
7
by: Techhead | last post by:
I have a date/time field with a sql format of "datetime" The actual date/time data format is MM/DD/YYYY^hh:mm:ss:pm or "1/25/2007 12:00:16 AM" Both the date and time are combined on the same field...
1
by: mr k | last post by:
Hi, I wanted to use mail merge with forms but Text form fields are not retained during mail merge in Word, I got the code from Microsoft but it doesn't remember the text form field options such as...
4
by: JamesG | last post by:
Hi, I'm new to C-Sharp (as of today) and i'm struggling to implement a SOAP client to a PHP5 web service. I have added the Web Reference (do I also need to use wsdl.exe and compile the .dll, and...
5
by: CiPiD | last post by:
Possibly a really dumb question but I am still a SQL Padawan. Running SQL 2000 on Windows 2003 if i issue the command select Getdate() i get the reply in the format yyyy-mm-dd hh:mm:ss.mmm which...
1
by: news.microsoft.com | last post by:
I have a form field that accepts a start time and one that accepts an end time. I am using a masked editor that allows the user to enter the hour and minutes and am and pm. When I save the form...
1
by: =?Utf-8?B?YXZucmFv?= | last post by:
We have a web service that gets data in xml format. In that Xml data, we parse few date fields that are in this format <data datefield="12/26/2008" timefield="16:33:45" ...> we parse it into a...
0
by: =?Utf-8?B?YXZucmFv?= | last post by:
We have a web service that gets data in xml format. In that Xml data, we parse few date fields that are in this format <data datefield="12/26/2008" timefield="16:33:45" ...> we parse it into a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.