Friday, March 9, 2012

Execute SQL Task question

I need to get the curent date from within a Execute SQL Task step,

I tried this

Declare @.Date as datetime
set @.Date = SELECT GETDATE()

..and this

Declare @.Date as datetime

set @.Date = Date

...without any luck.

I need the date as mm/dd/yyyy, anyone know how?

Thanks,
JavawabaSELECT CONVERT(varchar, GETDATE(), 101)

Greg.|||

Hello,

You can write a query like : "select convert(varchar,getdate(),101) as r_currentdt" and assign this result to some variable in the result mapping. Note:R_currentdt is a resultset name which you have to assign to some variable of the type string and can use any where within the scope.

Regards,

Raju

No comments:

Post a Comment