The CreatorCon Call for Content is officially open! Get started here.

Need to pull report Due date to expiry before 7days on website table

Srinath Pasulad
Tera Contributor

Hello Team,

 

Please find query below,

I want to pull the report when due date to expiry before 7 days. Please let me know how to add condition in report.

I have used below condition but not working and need exact 7days before result, not required 7days more or less data. 

Due -relative before 7 days from now.

Report on cmdb_ci_web_site table

 

Thanks in advance.

 

Regards,

Srinath.

4 REPLIES 4

Anshul Rawat
Tera Contributor

To pull a report on the cmdb_ci_web_site table for records where the due date is exactly 7 days before the current date, you can use the following condition:

Due-7d@javascript:gs.dateGenerate(gs.nowDateTime(), 'start')@javascript:gs.dateGenerate(gs.nowDateTime(), 'end')

This condition will return records where the due date falls exactly 7 days before the current date, without including any records with due dates more or less than 7 days before the current date.

To apply this condition to your report:

  1. Go to the report editor and select the cmdb_ci_web_site table.
  2. Add a filter for the Due field.
  3. In the filter condition, select the "Relative" option and enter the following string: Due-7d@javascript:gs.dateGenerate(gs.nowDateTime(), 'start')@javascript:gs.dateGenerate(gs.nowDateTime(), 'end')
  4. Save the filter and run the report to view the results.

Note: This condition assumes that the "Due" field in your cmdb_ci_web_site table is a date/time field. If it is a string field, you may need to modify the condition to convert the string to a date/time format before applying the relative date calculation.

I am not able find above options except "before" and "after" please find screenshot 

SrinathPasulad_0-1680782772224.png

 


@Srinath Pasulad wrote:

I am not able find above options except "before" and "after" please find screenshot 

SrinathPasulad_0-1680782772224.png

 


Navigate to the Reports module in the left-hand navigation pane.

Click on the New button to create a new report.

Select the cmdb_ci_web_site table as the data source for the report.

Click on the Add Condition button to add a new condition.

Enter due_on as the field name for the condition.

Select is as the operator for the condition.

Enter the following value for the condition: "javascript:gs.dateGenerate(gs.nowDateTime(), -7).getDate();"

Click on the Run button to preview the report.

If the report looks correct, click on the Save button to save the report for future use.

This should generate a report on the cmdb_ci_web_site table that shows only records where the due date is exactly 7 days before the current date.

 

TRY THIS

Could you please provide screenshot of filter condition , actually i am not able see the options.