Solved

easy sql

Posted on 2011-09-16
4
181 Views
Last Modified: 2012-05-12
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?
0
Comment
Question by:1jaws
  • 2
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
Comment Utility
try:

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

Author Comment

by:1jaws
Comment Utility
we are adding this to select statement how?
0
 

Author Comment

by:1jaws
Comment Utility
ignore what I said... sorry.. thanks for the help.
0
 
LVL 51

Expert Comment

by:HainKurt
Comment Utility
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
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now