Link to home
Start Free TrialLog in
Avatar of gunite
guniteFlag for United States of America

asked on

Format DateTime Picker

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?
Avatar of Chris Luttrell
Chris Luttrell
Flag of United States of America image

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
Avatar of gunite

ASKER

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.
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)
Avatar of gunite

ASKER

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

ASKER

LOL we posted at the same time.
ASKER CERTIFIED SOLUTION
Avatar of Chris Luttrell
Chris Luttrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gunite

ASKER

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.
Glad to help.  Good luck with your continued learning.