Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick data conversion question using CAST? 1

Status
Not open for further replies.
Apr 3, 2003
180
US
SELECT ID, ACTIVATE, DEACTIVATE,
CAST(ACTIVATE AS VARCHAR) AS [Activate Date],
CAST(DEACTIVATE AS VARCHAR) AS [Deactivate Date]
FROM VENDOR

In the above statement how do you keep the original ACTIVATE and DEACTIVATE from being returned in the result set? In other words, I only want to see the converted date in the query result.

ACTIVATE and DEACTIVATE are smalldatetime

Thanks in advance for anyone's time

"I hear and I forget. I see and I remember. I do and I understand."
- Confucius (551 BC - 479)
 
Remote the raw values from the SELECT statement and they will no longer be included. The original values are not required to be shown.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Cool, thanks again.

"I hear and I forget. I see and I remember. I do and I understand."
- Confucius (551 BC - 479)
 
np

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top