Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CAST vs CONVERT

Posted on 2009-07-10
1
Medium Priority
?
1,011 Views
Last Modified: 2012-05-07
What is the difference between CAST and CONVERT ?
0
Comment
Question by:finance_teacher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
MPDeveloper earned 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

636 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