?
Solved

Format DateTime Picker

Posted on 2009-05-01
8
Medium Priority
?
928 Views
Last Modified: 2012-05-06
When using the date time picker to fill a parameter in a report is there a way to format the output so it only returns mm/dd/yyyy (ex. 04/01/2009) instead of returning the Date and Time?
0
Comment
Question by:gunite
  • 4
  • 4
8 Comments
 
LVL 27

Expert Comment

by:Chris Luttrell
ID: 24282025
The underlying type is always a DateTime datatype.  Just use
=Format(Fields!yourDate.Value, "MM/dd/yyyy")
or something like that for the display format when displayed
0
 

Author Comment

by:gunite
ID: 24282066
I tried that before on the proc in the WHERE  (A.Date >=Format(@startdate, "MM/dd/yyyy"))  and I get Format is not a built-in function.
0
 
LVL 27

Expert Comment

by:Chris Luttrell
ID: 24282154
yeah, Format is not SQL it is a Reporting Services function.
If it is in SQL that you want just the date try,
SELECT CONVERT(VARCHAR,yourDate,101)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:gunite
ID: 24282161
I also tried WHERE  (A.Date >=convert(varchar,@startdate,101)) to no avail.  The date field had to be a varchar on the table.
0
 

Author Comment

by:gunite
ID: 24282164
LOL we posted at the same time.
0
 
LVL 27

Accepted Solution

by:
Chris Luttrell earned 200 total points
ID: 24282179
Is A.Date a DATETIME field in the table?  And is @startdate declared as datetime?  Where does @startdate get its value from?  sorry for so many questions, but I have to see where to intecept and make the change.
0
 

Author Comment

by:gunite
ID: 24282209
It worked fine once I declared @startdate as a datetime.  Thank you for the help.  It seems so simple sometimes once you find out what the solution is.  I have a lot to learn.
0
 
LVL 27

Expert Comment

by:Chris Luttrell
ID: 24282248
Glad to help.  Good luck with your continued learning.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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 video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

862 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