niceguy971
asked on
Sql Isnull()
I have the following Select statement:
select CustomerID, Name,
CASE
WHEN (CONVERT(varchar(10),(ISNU LL(BuyDate , '')), 110)='01-01-1900') THEN (' ')
ELSE (CONVERT(varchar(10),(ISNU LL(BuyDate , '')), 110))
END as BuyDate
from Customers;
BuyDate --it's datetime field in the Customers table
ISNULLL(BuyDate, '') returns 01-01-1900 if BuyDate contains NULL.
Is there BETTER WAY to re-write the below piece of my sql sttement ???
CASE
WHEN (CONVERT(varchar(10),(ISNU LL(BuyDate , '')), 110)='01-01-1900') THEN (' ')
ELSE (CONVERT(varchar(10),(ISNU LL(BuyDate , '')), 110))
END as BuyDate
Thanks
select CustomerID, Name,
CASE
WHEN (CONVERT(varchar(10),(ISNU
ELSE (CONVERT(varchar(10),(ISNU
END as BuyDate
from Customers;
BuyDate --it's datetime field in the Customers table
ISNULLL(BuyDate, '') returns 01-01-1900 if BuyDate contains NULL.
Is there BETTER WAY to re-write the below piece of my sql sttement ???
CASE
WHEN (CONVERT(varchar(10),(ISNU
ELSE (CONVERT(varchar(10),(ISNU
END as BuyDate
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER