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
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Date concatane

Author  Topic 

basicconfiguration
Constraint Violating Yak Guru

358 Posts

Posted - 2009-04-03 : 18:08:21
I have two columns DATE and TIME and I want to concatenate them.


-- DATE
picpuprdt datetime2 NULL
NULL
1

-- TIME
picpuprtm char(8) NULL
NULL
2





PickupProposalTime NULL
if picpuprdt is null
PickupProposalTime = picpuprdt
else
if picpuprdt is valid date and picpuprtm is valid then
PickupProposalTime = picpuprdt + picpuprtm


I have this executed in taskScript. But it's not working. A little bit of help is needed.

If Row.picpuprdt_IsNull Then
Row.PickupProposalTime = Row.picpuprdt
ElseIf Row.picpuprdt <> CDate("01/01/0001") And Row.Validpicpuprtm Then
Row.PickupProposalTime = Row.picpuprdt + " " + Row.picpuprtm
Else
Row.PickupProposalTime = Row.picpuprdt
End If





SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-15 : 18:04:58
SELECT picpuprdt + cast(picpuprtm as datetime2)



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -