Solved

easy sql

Posted on 2011-09-16
4
183 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
ID: 36552268
try:

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

Author Comment

by:1jaws
ID: 36552274
we are adding this to select statement how?
0
 

Author Comment

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

Expert Comment

by:HainKurt
ID: 36552296
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

778 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