Friday, February 24, 2012

format date parameter

Hi,
I need to format a datetime parameter to date only but it does not seem to
work for me. My parameter = DateAdd("d",-5,Format(Now(),"d")) but it it
includes time. I need to convert it to MM d yyyy.
Thanks,
JimJim,
If the parameter type is set to DateTime, it will always display the time
even if not given. This is because the SQL database type datetime always
includes this data. If you want, you can change the parameter type to
string, and it will be displayed however you format the date in your default
calculation.
David
"Jim" wrote:
> Hi,
> I need to format a datetime parameter to date only but it does not seem to
> work for me. My parameter = DateAdd("d",-5,Format(Now(),"d")) but it it
> includes time. I need to convert it to MM d yyyy.
> Thanks,
> Jim|||That does the trick. Thanks David.
"David Siebert" wrote:
> Jim,
> If the parameter type is set to DateTime, it will always display the time
> even if not given. This is because the SQL database type datetime always
> includes this data. If you want, you can change the parameter type to
> string, and it will be displayed however you format the date in your default
> calculation.
> David
> "Jim" wrote:
> > Hi,
> >
> > I need to format a datetime parameter to date only but it does not seem to
> > work for me. My parameter = DateAdd("d",-5,Format(Now(),"d")) but it it
> > includes time. I need to convert it to MM d yyyy.
> >
> > Thanks,
> > Jim

No comments:

Post a Comment