Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I change the date format from mm/dd/yyyy hh:mm"ss AM to mm/dd/yy

Posted on 2008-10-07
10
Medium Priority
?
922 Views
Last Modified: 2012-05-05
I am using a Reporting Services report but I cannot figure out how to change the date format to print mm/dd/yyyy Right now the date prints as mm/dd/yyyy hh:mm:ss AM

0
Comment
Question by:expertsexchangehunter
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 22663045
in tsql:

select convert(varchar(10), yourdatefield, 101)
from yourtablename
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22663108
actually, 101 is mm/dd/yyyy,
1 is mm/dd/yy



select convert(varchar(10), getdate(),1)
select convert(varchar(10), getdate(),101)

But this would be, as chapmandew stated, a change in the SQL, not in the reporting services field.
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22663126
>>I cannot figure out how to change the date format to print mm/dd/yyyy

I am pretty sure that is what the author asked for.  ;)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22663146
You're right.  I only saw the one in the title which was mm/dd/yy.  :)
0
 

Author Comment

by:expertsexchangehunter
ID: 22663161
I already have isNull(Issue.IDate, '') as IDate. If there is a way to use both IsNull and convert that would be great but I don'y know how.


0
 
LVL 60

Accepted Solution

by:
chapmandew earned 2000 total points
ID: 22663165
select ISNULL(convert(varchar(10), yourdatefield, 101), '')
from yourtablename
0
 
LVL 5

Expert Comment

by:brady1408
ID: 22663187
Just use ISNULL(select convert(varchar(10), yourdatefield, 101),'') Like the experts said
if the date is null the convert will return a null and your statement will still fork
0
 
LVL 5

Expert Comment

by:brady1408
ID: 22663196
fork? I swear I typed in work, either way chapmandew already answered it :)
0
 

Author Comment

by:expertsexchangehunter
ID: 22663294
Even though there is a date in the field
select ISNULL(convert(varchar(10), yourdatefield, 101), '')
from yourtablename
returns a blank field
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22663312
paste your date value on here.
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

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

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

810 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