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
854 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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 …

786 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