Link to home
Start Free TrialLog in
Avatar of rcowen00
rcowen00Flag for United States of America

asked on

SQL 2008 Stored Procedure Combining 2 Fields

I can't seem to get the correct syntax to covert the date time field (ClientDueDate) to varchar to I can then combine with field 2 (WkDay) to show 04/12/2012 - Wed.  The end result will be populating a gridview in asp.net so if there is an easier way, I am open to suggestions.  Thanks!


DATEADD(minute, - 60, dbo.GetOrderCurrentClientDue(op.OrdersProductKey)) AS ClientDueDate, 
							 dbo.GetWeekDayNameOfDate(DATEADD(minute, - 60, dbo.GetOrderCurrentClientDue(op.OrdersProductKey))) AS WkDay

Open in new window

Avatar of wdosanjos
wdosanjos
Flag of United States of America image

Just convert it to varchar as below:

CONVERT(DATEADD(minute, - 60, dbo.GetOrderCurrentClientDue(op.OrdersProductKey)), varchar(20), 101) AS ClientDueDate, 
dbo.GetWeekDayNameOfDate(DATEADD(minute, - 60, dbo.GetOrderCurrentClientDue(op.OrdersProductKey))) AS WkDay

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial