Welcome, Guest
Username: Password: Remember me

TOPIC: Filtering a date 90 days ago

Filtering a date 90 days ago #1931

I am trying to establish a filter to pull requests made exactly 90 days ago and I am having trouble getting anything to work. The system dates available don't get me close. I know there is probably something simple to put into the compare value field that will enter a date. Any idea?

I am in the query portion of Event Manager and I am using dbo.Absences.syscreated field. I am wanting todays date - 90 days

Thanks,

Manville
The administrator has disabled public write access.

Filtering a date 90 days ago #1932

  • ddozer
  • ddozer's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 51
  • Karma: 0
on the SQL portion of the query builder check the box to manually modify the query and use a condition comparing syscreated to (getdate()-90) fro example:

select * from absences where syscreated <= (getdate()-90)
The administrator has disabled public write access.

Filtering a date 90 days ago #1933

I must be doing something wrong.....

SELECT DISTINCT dbo.Absences.HID AS "HID", dbo.RequestTasks.Created AS "Created", dbo.Absences.ProjectNumber AS "ProjectNumber", dbo.Absences.syscreated AS "syscreated", dbo.cicmpy.cmp_wwn AS "cmp_wwn" FROM ((dbo.Absences LEFT OUTER JOIN dbo.cicmpy ON dbo.Absences.CustomerID = dbo.cicmpy.cmp_wwn) LEFT OUTER JOIN dbo.RequestTasks ON dbo.Absences.ID = dbo.RequestTasks.RequestID) WHERE dbo.Absences.Type = 88 AND select * from absences where syscreated <= (getdate()-90)

I get an invalid syntax near select
The administrator has disabled public write access.

Filtering a date 90 days ago #1934

  • pshirley
  • pshirley's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 54
  • Thank you received: 6
  • Karma: 1
You've got two SELECT statements together there. Try this;
SELECT DISTINCT dbo.Absences.HID AS "HID", dbo.RequestTasks.Created AS "Created", dbo.Absences.ProjectNumber AS "ProjectNumber", dbo.Absences.syscreated AS "syscreated", dbo.cicmpy.cmp_wwn AS "cmp_wwn" FROM ((dbo.Absences LEFT OUTER JOIN dbo.cicmpy ON dbo.Absences.CustomerID = dbo.cicmpy.cmp_wwn) LEFT OUTER JOIN dbo.RequestTasks ON dbo.Absences.ID = dbo.RequestTasks.RequestID) WHERE dbo.Absences.Type = 88 AND dbo.Absences.syscreated <= (getdate()-90)
Peter Shirley
www.erpessentials.com
The administrator has disabled public write access.

Filtering a date 90 days ago #1935

PERFECT!!!!

Thank you, It worked.
The administrator has disabled public write access.
Time to create page: 0.037 seconds
Powered by Kunena Forum  Protected by R Antispam