Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
MSSQL Tutorial
Data Convert Functions 47 codes
Home
MSSQL Tutorial
Data Convert Functions
1 A SELECT statement that substitutes a different data type
2 A SELECT statement that uses the COALESCE function
3 COALESCE is equivalent to a CASE expression that returns the first NOT NULL expression in a list of expressions
4 COALESCE() saves quite a lot of IF or CASE decision logic
5 Code that tests whether a database exists before it deletes it
6 Combine CAST and ISNULL
7 Compare date type value after converting
8 Conversion failed when converting the varchar value abc to data type int
9 CONVERT function syntax
10 CONVERT() function requires two arguments
11 CONVERT(char(10), GETDATE(), 112)
12 CONVERT(char(8), BillingDate, 1) and CONVERT(varchar(9), PaymentTotal, 1)
13 CONVERT(datetime, 20000704)
14 CONVERT(varchar(10), advance, 2)
15 CONVERT(varchar(12), OrderDate, 5)
16 CONVERT(varchar(20), GETDATE())
17 CONVERT(varchar,BillingDate,100) Mmm dd yyyy hh
18 CONVERT(varchar,BillingDate,101) mmddyyyy
19 CONVERT(varchar,BillingDate,103) ddmmyyyy
20 Data type conversion can be performed using the CAST() and CONVERT() functions
21 Performing Flexible Searches Using ISNULL
22 Replacing null values with zero values with ISNULL
23 Returning a NULL Value When Two Expressions Are Equal
24 Returning the First Non NULL Value in a List of Expressions
25 SELECT ANSI Date
26 SELECT CAST(123 4 AS Decimal)
27 Select CAST(2002-09-30 11
28 Select CAST(CAST(2002-09-30 AS datetime) - CAST(2001-12-01 AS datetime) AS int)
29 Select CONVERT (INTEGER , 123)
30 SELECT CONVERT(datetime, 10 12 99,1)
31 SELECT CONVERT(datetime, 10 12 99,4)
32 SELECT CONVERT(VarChar(50), @Num, 0)
33 SELECT Default Date
34 SELECT German Date
35 SELECT statement using the ISNULL function
36 SELECT UKFrench Date
37 SELECT US Date
38 System function ISNULL allows a display of the specified value as substitution for NULL
39 The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value
40 The DROP Database Statement
41 The syntax of the CAST function
42 The syntax of the CONVERT function CONVERT(data_type, expression [, style])
43 The syntax of the ISNULL function
44 Update and ISNULL
45 Use cast function in dynamic sql
46 Use convert function with variables
47 Values for the style argument of the CONVERT function when you convert a datetime expression to a character express