Solved

CAST vs CONVERT

Posted on 2009-07-10
1
1,003 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 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

696 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