Video Screencast Help

Report Parameter

Created: 18 Apr 2012 • Updated: 24 Apr 2012 | 5 comments
This issue has been solved. See solution.

I noticed the Discovered Devices has a date parameter with a default value of today-1.  The term or keyword today supplies todays date as the default parameter.  Are there other terms or keywords which can be used to make variable default parameters?

Comments 5 CommentsJump to latest comment

mclemson's picture

Are you looking at Reports > Discovery and Inventory > Discovered Devices?  Mine has a date parameter for start and a date parameter for end, and doesn't have the word Today.  If you look at the SQL, however, @StartDate is set to GETDATE()-30 and @EndDate is set to GETDATE().  In SQL, GETDATE() returns today's date.

Mike Clemson, Senior Systems Engineer, ASC
Intuitive Technology Group -- Symantec Platinum Partner
intuitivetech.com

EathenR's picture

Yes that is the report I was viewing.  It is found in the XML file.  You can't enter it in the SQL, but you can enter it as the default value of the report parameter dialog. 

In my report the GetDate()-30 is commented out.

- <parameter>
  <name>DateRangeFrom</name>
  <description>Date range: From</description>
  <required>true</required>
  <nullable>false</nullable>
  <parameterType>PType-DateTime</parameterType>
  <defaultValue>today-1</defaultValue>
  <order>10</order>
- <valueProvider classType="Altiris.Reporting.Parameters.ParameterValueEditControls.DateTimeValueEditControl">
- <configuration readonly="False" hideOnError="False">
  <style labelVisible="True" labelText="Date range: From" timeVisible="True" dateVisible="True" alwaysUseDefault="True" />
  </configuration>
  </valueProvider>
  <requiredParameters />
  <configurationControlClassGuid>73bded50-f1aa-4ff4-a80e-a6c9e047d472</configurationControlClassGuid>
  </parameter>

 

mclemson's picture

Seems to be pulled from this:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx

Mike Clemson, Senior Systems Engineer, ASC
Intuitive Technology Group -- Symantec Platinum Partner
intuitivetech.com

EathenR's picture

I'm able to use 'now' and 'today' successfully, but I'm not able to use the others (e.g. today-day(today)).  I was hoping to have a default parameter date of today minus one month.  I'll have to settle for today-31.

mclemson's picture

Correct.  today-31 is the correct way to do this.  You can see elsehwere in the .xml they use day-1.

Mike Clemson, Senior Systems Engineer, ASC
Intuitive Technology Group -- Symantec Platinum Partner
intuitivetech.com

SOLUTION