Sunday, 25 February 2018

Differents between Cast and Convert function using Sql Server

1.select distinct cast(FromDate as Varchar) FromDate from tblpolicymaster where policyno=234000211

2.select distinct Convert(Varchar,FromDate,103) FromDate from tblpolicymaster where policyno=234000211

3.using both cast & convert
select distinct cast(Convert(Varchar,FromDate,103)as varchar) FromDate from tblpolicymaster where policyno=234000211

No comments:

Post a Comment