Wednesday, March 21, 2012

Date Parameter

My report contains a date-time parameter. When the report is run it displays
both the date and time portions in my date drop down box e.g. 01/01/2004
12:00:00 AM.
How would I change this to only display the 01/01/2004 ?
Note: I want to maintain system localized date format.Try =FormatDateTime(Fields!myDate.Value, vbShortDate).
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
news:F313E096-482A-4541-AC49-D929964A14D4@.microsoft.com...
> My report contains a date-time parameter. When the report is run it
displays
> both the date and time portions in my date drop down box e.g. 01/01/2004
> 12:00:00 AM.
> How would I change this to only display the 01/01/2004 ?
> Note: I want to maintain system localized date format.|||Hi Ravi:
Where should I place it?
"Ravi Mumulla (Microsoft)" wrote:
> Try =FormatDateTime(Fields!myDate.Value, vbShortDate).
> --
> Ravi Mumulla (Microsoft)
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> news:F313E096-482A-4541-AC49-D929964A14D4@.microsoft.com...
> > My report contains a date-time parameter. When the report is run it
> displays
> > both the date and time portions in my date drop down box e.g. 01/01/2004
> > 12:00:00 AM.
> >
> > How would I change this to only display the 01/01/2004 ?
> >
> > Note: I want to maintain system localized date format.
>
>|||Click on the control you want to format (the particular field in the table
control, or a texbox for example) and go to properties, format, select
expression and put this in when the expression box comes up.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
news:C04EC5F8-0C74-41E7-B0BD-8886FD0395B6@.microsoft.com...
> Hi Ravi:
> Where should I place it?
> "Ravi Mumulla (Microsoft)" wrote:
> > Try =FormatDateTime(Fields!myDate.Value, vbShortDate).
> >
> > --
> > Ravi Mumulla (Microsoft)
> > SQL Server Reporting Services
> >
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > news:F313E096-482A-4541-AC49-D929964A14D4@.microsoft.com...
> > > My report contains a date-time parameter. When the report is run it
> > displays
> > > both the date and time portions in my date drop down box e.g.
01/01/2004
> > > 12:00:00 AM.
> > >
> > > How would I change this to only display the 01/01/2004 ?
> > >
> > > Note: I want to maintain system localized date format.
> >
> >
> >|||I am attempting to chnage the date format in the parameter control bar... as
far as I can see there is no properties selection to choose from.
"Bruce L-C [MVP]" wrote:
> Click on the control you want to format (the particular field in the table
> control, or a texbox for example) and go to properties, format, select
> expression and put this in when the expression box comes up.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> news:C04EC5F8-0C74-41E7-B0BD-8886FD0395B6@.microsoft.com...
> > Hi Ravi:
> >
> > Where should I place it?
> >
> > "Ravi Mumulla (Microsoft)" wrote:
> >
> > > Try =FormatDateTime(Fields!myDate.Value, vbShortDate).
> > >
> > > --
> > > Ravi Mumulla (Microsoft)
> > > SQL Server Reporting Services
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > > news:F313E096-482A-4541-AC49-D929964A14D4@.microsoft.com...
> > > > My report contains a date-time parameter. When the report is run it
> > > displays
> > > > both the date and time portions in my date drop down box e.g.
> 01/01/2004
> > > > 12:00:00 AM.
> > > >
> > > > How would I change this to only display the 01/01/2004 ?
> > > >
> > > > Note: I want to maintain system localized date format.
> > >
> > >
> > >
>
>|||Ahh, sorry. Everybody answering you was answering with regards to the
report. The parameter tool bar can not be modified as far as I know. You
have the option of creating your own web page and then integrate into RS
using URL control or web services.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
news:90B96A06-51F8-4E7C-BBD3-BBD671BA5887@.microsoft.com...
> I am attempting to chnage the date format in the parameter control bar...
as
> far as I can see there is no properties selection to choose from.
> "Bruce L-C [MVP]" wrote:
> > Click on the control you want to format (the particular field in the
table
> > control, or a texbox for example) and go to properties, format, select
> > expression and put this in when the expression box comes up.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > news:C04EC5F8-0C74-41E7-B0BD-8886FD0395B6@.microsoft.com...
> > > Hi Ravi:
> > >
> > > Where should I place it?
> > >
> > > "Ravi Mumulla (Microsoft)" wrote:
> > >
> > > > Try =FormatDateTime(Fields!myDate.Value, vbShortDate).
> > > >
> > > > --
> > > > Ravi Mumulla (Microsoft)
> > > > SQL Server Reporting Services
> > > >
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > > > news:F313E096-482A-4541-AC49-D929964A14D4@.microsoft.com...
> > > > > My report contains a date-time parameter. When the report is run
it
> > > > displays
> > > > > both the date and time portions in my date drop down box e.g.
> > 01/01/2004
> > > > > 12:00:00 AM.
> > > > >
> > > > > How would I change this to only display the 01/01/2004 ?
> > > > >
> > > > > Note: I want to maintain system localized date format.
> > > >
> > > >
> > > >
> >
> >
> >|||Crystal Reports has the option to convert all date-time to dates.
This allows you to bring up all records which occured between a certain date
range irrespective of the time.
Having the time portion in RS causes problems. If I want to pull up all
records which occured from 1 jan 2004 to 1 jan 2004. RS views this as being 1
jan 2004 12 am to 1 jan 2004 12 am. It therefore leaves out the other 23:59
hours on Jan 1.
Are you saying this is not possible in RS without a custom webpage?
"Bruce L-C [MVP]" wrote:
> Ahh, sorry. Everybody answering you was answering with regards to the
> report. The parameter tool bar can not be modified as far as I know. You
> have the option of creating your own web page and then integrate into RS
> using URL control or web services.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> news:90B96A06-51F8-4E7C-BBD3-BBD671BA5887@.microsoft.com...
> > I am attempting to chnage the date format in the parameter control bar...
> as
> > far as I can see there is no properties selection to choose from.
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > Click on the control you want to format (the particular field in the
> table
> > > control, or a texbox for example) and go to properties, format, select
> > > expression and put this in when the expression box comes up.
> > >
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > > news:C04EC5F8-0C74-41E7-B0BD-8886FD0395B6@.microsoft.com...
> > > > Hi Ravi:
> > > >
> > > > Where should I place it?
> > > >
> > > > "Ravi Mumulla (Microsoft)" wrote:
> > > >
> > > > > Try =FormatDateTime(Fields!myDate.Value, vbShortDate).
> > > > >
> > > > > --
> > > > > Ravi Mumulla (Microsoft)
> > > > > SQL Server Reporting Services
> > > > >
> > > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > > > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > > > > news:F313E096-482A-4541-AC49-D929964A14D4@.microsoft.com...
> > > > > > My report contains a date-time parameter. When the report is run
> it
> > > > > displays
> > > > > > both the date and time portions in my date drop down box e.g.
> > > 01/01/2004
> > > > > > 12:00:00 AM.
> > > > > >
> > > > > > How would I change this to only display the 01/01/2004 ?
> > > > > >
> > > > > > Note: I want to maintain system localized date format.
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||If you are going against SQL Server database it only has a datetime data
type. It does not have a separate date and time datatypes. I do all my
reports >= fromdate and < todate. So if you want a day's worth of data it is
between 1/1/04 00:00:00 and 1/2/04 00:00:00
One point, you can always ignore the time portion. The report parameter and
the query parameter are two different thing and you can map the query
parameter to an expression which takes the report parameter and strips the
time part of it. The downside of this is that the user will see the time in
the parameter bar.
One other point, you can have a text parameter instead of the date
parameter. The user puts in the date as text and then you do whatever you
want with it during the assignment to the query parameter.
The portal that RS provides in version 1 is limited with how you can
customize it. Hopefully we will see some improvements. For instance it sure
would be nice to format the parameters (as you mentioned) or add custom
error checking to it. Or a datepicker would be nice. No special knowledge of
what the improvements would be. Just that I do agree with you that more
control and options with it would be nice.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
news:53A33C93-0483-4305-BBF2-988B618FFF2D@.microsoft.com...
> Crystal Reports has the option to convert all date-time to dates.
> This allows you to bring up all records which occured between a certain
date
> range irrespective of the time.
> Having the time portion in RS causes problems. If I want to pull up all
> records which occured from 1 jan 2004 to 1 jan 2004. RS views this as
being 1
> jan 2004 12 am to 1 jan 2004 12 am. It therefore leaves out the other
23:59
> hours on Jan 1.
> Are you saying this is not possible in RS without a custom webpage?
> "Bruce L-C [MVP]" wrote:
> > Ahh, sorry. Everybody answering you was answering with regards to the
> > report. The parameter tool bar can not be modified as far as I know. You
> > have the option of creating your own web page and then integrate into RS
> > using URL control or web services.
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > news:90B96A06-51F8-4E7C-BBD3-BBD671BA5887@.microsoft.com...
> > > I am attempting to chnage the date format in the parameter control
bar...
> > as
> > > far as I can see there is no properties selection to choose from.
> > >
> > > "Bruce L-C [MVP]" wrote:
> > >
> > > > Click on the control you want to format (the particular field in the
> > table
> > > > control, or a texbox for example) and go to properties, format,
select
> > > > expression and put this in when the expression box comes up.
> > > >
> > > >
> > > > --
> > > > Bruce Loehle-Conger
> > > > MVP SQL Server Reporting Services
> > > > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > > > news:C04EC5F8-0C74-41E7-B0BD-8886FD0395B6@.microsoft.com...
> > > > > Hi Ravi:
> > > > >
> > > > > Where should I place it?
> > > > >
> > > > > "Ravi Mumulla (Microsoft)" wrote:
> > > > >
> > > > > > Try =FormatDateTime(Fields!myDate.Value, vbShortDate).
> > > > > >
> > > > > > --
> > > > > > Ravi Mumulla (Microsoft)
> > > > > > SQL Server Reporting Services
> > > > > >
> > > > > > This posting is provided "AS IS" with no warranties, and confers
no
> > > > rights.
> > > > > > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > > > > > news:F313E096-482A-4541-AC49-D929964A14D4@.microsoft.com...
> > > > > > > My report contains a date-time parameter. When the report is
run
> > it
> > > > > > displays
> > > > > > > both the date and time portions in my date drop down box e.g.
> > > > 01/01/2004
> > > > > > > 12:00:00 AM.
> > > > > > >
> > > > > > > How would I change this to only display the 01/01/2004 ?
> > > > > > >
> > > > > > > Note: I want to maintain system localized date format.
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||I know this is an old thread but in my searches for an answer.....
Anyway I figured out a solution:
=Today.ToShortDateString()
or if you need to add days:
=Today.AddDays(-2).ToShortDateString()
Hope this helps
"Bruce L-C [MVP]" wrote:
> If you are going against SQL Server database it only has a datetime data
> type. It does not have a separate date and time datatypes. I do all my
> reports >= fromdate and < todate. So if you want a day's worth of data it is
> between 1/1/04 00:00:00 and 1/2/04 00:00:00
> One point, you can always ignore the time portion. The report parameter and
> the query parameter are two different thing and you can map the query
> parameter to an expression which takes the report parameter and strips the
> time part of it. The downside of this is that the user will see the time in
> the parameter bar.
> One other point, you can have a text parameter instead of the date
> parameter. The user puts in the date as text and then you do whatever you
> want with it during the assignment to the query parameter.
> The portal that RS provides in version 1 is limited with how you can
> customize it. Hopefully we will see some improvements. For instance it sure
> would be nice to format the parameters (as you mentioned) or add custom
> error checking to it. Or a datepicker would be nice. No special knowledge of
> what the improvements would be. Just that I do agree with you that more
> control and options with it would be nice.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> news:53A33C93-0483-4305-BBF2-988B618FFF2D@.microsoft.com...
> > Crystal Reports has the option to convert all date-time to dates.
> >
> > This allows you to bring up all records which occured between a certain
> date
> > range irrespective of the time.
> >
> > Having the time portion in RS causes problems. If I want to pull up all
> > records which occured from 1 jan 2004 to 1 jan 2004. RS views this as
> being 1
> > jan 2004 12 am to 1 jan 2004 12 am. It therefore leaves out the other
> 23:59
> > hours on Jan 1.
> >
> > Are you saying this is not possible in RS without a custom webpage?
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > Ahh, sorry. Everybody answering you was answering with regards to the
> > > report. The parameter tool bar can not be modified as far as I know. You
> > > have the option of creating your own web page and then integrate into RS
> > > using URL control or web services.
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > > news:90B96A06-51F8-4E7C-BBD3-BBD671BA5887@.microsoft.com...
> > > > I am attempting to chnage the date format in the parameter control
> bar...
> > > as
> > > > far as I can see there is no properties selection to choose from.
> > > >
> > > > "Bruce L-C [MVP]" wrote:
> > > >
> > > > > Click on the control you want to format (the particular field in the
> > > table
> > > > > control, or a texbox for example) and go to properties, format,
> select
> > > > > expression and put this in when the expression box comes up.
> > > > >
> > > > >
> > > > > --
> > > > > Bruce Loehle-Conger
> > > > > MVP SQL Server Reporting Services
> > > > > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > > > > news:C04EC5F8-0C74-41E7-B0BD-8886FD0395B6@.microsoft.com...
> > > > > > Hi Ravi:
> > > > > >
> > > > > > Where should I place it?
> > > > > >
> > > > > > "Ravi Mumulla (Microsoft)" wrote:
> > > > > >
> > > > > > > Try =FormatDateTime(Fields!myDate.Value, vbShortDate).
> > > > > > >
> > > > > > > --
> > > > > > > Ravi Mumulla (Microsoft)
> > > > > > > SQL Server Reporting Services
> > > > > > >
> > > > > > > This posting is provided "AS IS" with no warranties, and confers
> no
> > > > > rights.
> > > > > > > "SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
> > > > > > > news:F313E096-482A-4541-AC49-D929964A14D4@.microsoft.com...
> > > > > > > > My report contains a date-time parameter. When the report is
> run
> > > it
> > > > > > > displays
> > > > > > > > both the date and time portions in my date drop down box e.g.
> > > > > 01/01/2004
> > > > > > > > 12:00:00 AM.
> > > > > > > >
> > > > > > > > How would I change this to only display the 01/01/2004 ?
> > > > > > > >
> > > > > > > > Note: I want to maintain system localized date format.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>sql

No comments:

Post a Comment