GetNext row value using vb/ssrs - vb.net

Please I need some help with VB in report builder to identify the next row value to populate the current row with the date minus 1 day. In ssrs report builder we are able to add vb code functions to extend the functionality of the ssrs reporting. We don't have access the data source tables and fields in the underlying dataset as it managed by the vendor. I am not able to execute a query include a row number field in the data set for look up of the next row value. Nor am I able to execute LAG/Lead functions.
We need to determine the next row (Transaction Posting date) value for Entity and partner Group.
For example, I have a transaction posting date of 02-10-2021 and the subsequent transaction for this same entity on 05-03-2021. Therefore "To" date for this transaction should be 02-28-2021. Subsequently, the transaction posting date from 05-03-2021, the "To" date will depend on the next transaction posting date. If I have another transaction within the same month, for example occurring on 05-10-2021. Then the "To" date for the subsequent transaction will be 05-09-2021.
enter image description here

Related

Keeping track of modifications in Power BI data

Let's say I have a list of the members of a team, and I keep track of their status (active/inactive, or present/absent, for instance). My file contains an id for each member, a column "updated at timestamp" as well as a column giving their current status. The list is updated daily, so some member's status can change from one day to the next.
What I would like to do is get the number of days the status was on "active/present" during a month (or a percentage of "active" during the month).
The problem being that the data is not stored : when there is an update, the column "status" changes but there is no history on whether it was on active/present or inactive/absent the previous day.
Could someone help me find a way to do that ?
Thanks in advance.
For the situation you mentioned, you can use a RDBMS systems. I am writing for SQL Server, probably you would use the "Temporal Table" for historical information.

Current month and prevoius month logic in cognos prompt page

I want to designed a report in a cognos which showcase data for current month or prevoius month choice on prompt page, need to get logic for this.
Please advice if any one has solution for this...
2 suggestions
Scenario 1) Put the current month and prior month values in a conditional block
Or if you don't want to do that,
Scenario 2)
Create two lists
One each way you want to present the data
Current Month
Prior Month
Then use rendering on the prompt to show the list the user selected

SQL query for limiting records

I have following SQL query in Data Flow, Control flow of SSIS package and I want to limit records by cutting off point, and that cut off point is current day/date from system. So, it should only display past records, not including todays. So, I think I need to use the specific field (which is date field - in the query its called 'FinalCloseDate' and compare with current system date and tell it to only to pull the records (perhaps < todays date) that happened before today or current system day.
Add
AND dbo.Producthit.FinalCloseDate < CAST(GETDATE() AS DATE)
to your WHERE clause.

Datagridview: How to pull only latest record for each Member ID from Access database

I am trying to create a library management system and using a DataGridView to see a list of people defaulted on payment (last payment date is more than 2 months old).
To do this, I plan to
Query the payment table for each Member ID and pick their last record,
Then do a check on payment date on this record and display it if it is more than two months old.
Can someone please help me with the code in VB. I am not able to make much progress on my own.
You can query the payment table with a WHERE Clause
eg.(Assume you're on MSSQL)
SELECT MemberID,WhatEverYouNeed
FROM PaymentTable
WHERE PaymentDate<DATEADD(MONTH,-2,GETDATE())
It will return you a set of result, if any.
Fill it with a SqlDataAdapter. Then, bind the datatable to your DGV

Performance difference between max and greater than in SQL

While designing a table which have impact based on date (e.g. Currency Rate) which one is better?
Effective date (Find out max(Effective date) and get the current value)
From Date - To Date condition (With greater than equals sysdate)
Rgrds.
It depends. You have a table representing changes to a particular entity, and you want to record when the entity changed, and when the change was replaced by a subsequent change.
1. If you record just the Effective Date for each event, INSERTs are simpler: they don't need to find the earlier record to update it. However, querying becomes more complex - you'll need to run a window over the dataset to find which record is applicable at any one time, potentially resulting in poorer performance.
Another downside is that this model is open-ended; you can't record a currency as "permanently closed" (which you could do if you had an End date).
2. If you record the Start and End dates for each event, queries are simpler: you only need to look at each row individually to know whether it is "current" as of any point in time or not. INSERTs, however, are slightly more complex - when you insert a new event, you have to update the earlier event to mark its End date.
This model is closed-ended; you can put a End date on the final event and have no "open" record.