• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 926
  • Last Modified:

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

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
expertsexchangehunter
Asked:
expertsexchangehunter
  • 4
  • 2
  • 2
  • +1
1 Solution
 
chapmandewCommented:
in tsql:

select convert(varchar(10), yourdatefield, 101)
from yourtablename
0
 
BrandonGalderisiCommented:
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
 
chapmandewCommented:
>>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
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
BrandonGalderisiCommented:
You're right.  I only saw the one in the title which was mm/dd/yy.  :)
0
 
expertsexchangehunterAuthor Commented:
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
 
chapmandewCommented:
select ISNULL(convert(varchar(10), yourdatefield, 101), '')
from yourtablename
0
 
brady1408Commented:
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
 
brady1408Commented:
fork? I swear I typed in work, either way chapmandew already answered it :)
0
 
expertsexchangehunterAuthor Commented:
Even though there is a date in the field
select ISNULL(convert(varchar(10), yourdatefield, 101), '')
from yourtablename
returns a blank field
0
 
chapmandewCommented:
paste your date value on here.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now