Link to home
Start Free TrialLog in
Avatar of 1jaws
1jawsFlag for United States of America

asked on

easy sql

select convert(varchar, o.dateSubmitted, 111) as dateSubmitted from tblCustomer

I have that query that I want to say if dateSubmitted is not null that time I want to "paid" on my datagrid...how can I make that happen?
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 1jaws

ASKER

we are adding this to select statement how?
Avatar of 1jaws

ASKER

ignore what I said... sorry.. thanks for the help.
first of all your query syntax is wrong. there is no alias as o

select convert(varchar, o.dateSubmitted, 111) as dateSubmitted from tblCustomer as o

-->

select
case when o.dateSubmitted is null then 'Paid' else convert(varchar, o.dateSubmitted, 111) end as dateSubmitted
from tblCustomer as o