TimBiesiek
Programmer
Hi all,
I have a column in a table that is storing just a date, and another column that used to store just the time. This 2nd column is now storing both the date and time (1/07/2005 11:57:00).
However, I have some old data that only has the time in this column. I want to update these records to have the date and time, but can't find an easy way to do it.
I have created an update query as below, but this updates the time field to 2 days before the date field...
For example, if the date was 10/07/2005 and the time was 11:57:00, this query would update the time field to show 8/07/2005 11:57:00.
Note that in the query, the where clause only pulls up the records that only have the time in...
Any help would be great thanks!
I have a column in a table that is storing just a date, and another column that used to store just the time. This 2nd column is now storing both the date and time (1/07/2005 11:57:00).
However, I have some old data that only has the time in this column. I want to update these records to have the date and time, but can't find an easy way to do it.
I have created an update query as below, but this updates the time field to 2 days before the date field...
Code:
UPDATE arc_FieldResult
SET RTime = RDate + ' ' + RTime
WHERE (SUBSTRING(CONVERT(varchar(50), RTime), 1, 11) = 'Dec 30 1899')
For example, if the date was 10/07/2005 and the time was 11:57:00, this query would update the time field to show 8/07/2005 11:57:00.
Note that in the query, the where clause only pulls up the records that only have the time in...
Any help would be great thanks!