Solved

SQL 2008 Stored Procedure Combining 2 Fields

Posted on 2012-04-03
2
277 Views
Last Modified: 2012-08-14
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

0
Comment
Question by:rcowen00
2 Comments
 
LVL 23

Expert Comment

by:wdosanjos
ID: 37803330
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

0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 500 total points
ID: 37803372
CONVERT(varchar(30), DATEADD(minute, - 60, dbo.GetOrderCurrentClientDue(op.OrdersProductKey)), 101) + ' - ' +
                                           dbo.GetWeekDayNameOfDate(DATEADD(minute, - 60, dbo.GetOrderCurrentClientDue(op.OrdersProductKey))) AS [Col_name]
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
xpath sql query 2008 8 41
Receiving a string from a WebService Push 21 31
Error in JQuery 5 35
.NET tools for adding thread safety to a web app? 3 6
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
A short film showing how OnPage and Connectwise integration works.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now