Need help with a query
Posted on 2016-10-27
In the query if the ExpPurchaseDt="" then Formatted_ExpPurchaseDt is coming as "01/01/1900". Is there anyway I can prevent it in the query. I want if ExpPurchaseDt="" then Formatted_ExpPurchaseDt should be "", otherwise it should format the date.
This is my query.
SELECT ExpPurchaseDt, CONVERT(VARCHAR, CONVERT(DATE, ExpPurchaseDt), 101) as Formatted_ExpPurchaseDt
FROM JOBDETAILS where JobOrOpportunity='O'
Thanks in advance.