- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 10:52 PM
Hi,
I've a database view to pull records from three tables. The report generation and distribution will be automated and i want to pull records for every 1 month. e.g. In the month of July, i want to pull records from 1st June to 30th June. I've tried something like this at the time_card_daily where clause:-
timecard_sys_id=timecarddaily_time_card && timecarddaily_date >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH) but it doesnt work. I've attached database view screenshot for your reference. Kindly advise on the solution.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 11:17 PM
Why go through the DB view to filter records? Why not just create a report with 'created on last month' that you schedule on every first of the month? Your DB view will contain all records and your report will only collect the ones from last month, while your scheduled report distributes it to all recipients.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 08:44 AM
HI @PatriciaA987250 ,
What timestamp are you trying to filter on when creating a database view on the tree tables? From my point of view, I would create a report based on the database view where I would set the conditions accordingly on all three tables. This can further more be a scheduled report, so you will receive it monthly according to your need.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 10:57 PM
Hi @PatriciaA987250,
please check below link:
https://www.servicenow.com/community/developer-forum/database-view-date-parameter/m-p/1417336
Thank you, please make helpful if you accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 11:17 PM
Why go through the DB view to filter records? Why not just create a report with 'created on last month' that you schedule on every first of the month? Your DB view will contain all records and your report will only collect the ones from last month, while your scheduled report distributes it to all recipients.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 08:44 AM
HI @PatriciaA987250 ,
What timestamp are you trying to filter on when creating a database view on the tree tables? From my point of view, I would create a report based on the database view where I would set the conditions accordingly on all three tables. This can further more be a scheduled report, so you will receive it monthly according to your need.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 08:33 PM
Sorry for the late reply. I wanted to filter based on date field from timecard daily table