Solved

CAST vs CONVERT

Posted on 2009-07-10
1
989 Views
Last Modified: 2012-05-07
What is the difference between CAST and CONVERT ?
0
Comment
Question by:finance_teacher
1 Comment
 
LVL 2

Accepted Solution

by:
MPDeveloper earned 500 total points
ID: 24827806
I'm going to assume that you meant to put this in the Sql area since CAST and CONVERT are not C# keywords.

CAST is ANSI standards based where CONVERT is SQL server only so use CAST if you're planning on executing this on other database versions. CAST is better at preserving decimal places, but CONVERT allows you to format the output. CONVERT has a third parameter that allows you to input a formatting string.

Other then that, they're very similiar.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This article will show, step by step, how to integrate R code into a R Sweave document
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

920 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

12 Experts available now in Live!

Get 1:1 Help Now