parvez khan

parvez khan

  • NA
  • 40
  • 6.8k

How to convert varchar to datetime in Sql server database

Jan 24 2017 2:12 PM
SELECT [BillNo],[BillDate],[Pts_Name],[Drs_Name],[Medi_Name],[BatchNo],[ExpDt],[MRP]
,[Qty],[Amount] FROM [MEDIDATANEW].[dbo].[CustBill]where (convert (datetime ,convert(datetime,convert(varchar,BillDate,103),103))between '2014-03-12' and '2014-03-23')
 
 
This script run in sqlserver 2008 But Not Run in sqlserver 2008R2 and upper version.
 
plz Help me 

Answers (6)