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
831 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
 
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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 60

Accepted Solution

by:
chapmandew earned 500 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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