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
881 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
How to increase the row limit in Jasper Server.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

728 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