Using offset fetch next only on condition

Using offset fetch next only on condition

What would the best way be of using offset next based on a condition.

What would the best way be of using offset next based on a condition.

Having something like this in mind but am getting compilation error.

        declare @Condition bit

    select
    canvas.CanvasName,
    c.CompanyID,
    c.CompanyName
    from JobCanvas_B2B canvas
    inner join JobActivity act on act.CanvasId = canvas.CanvasId
    inner join [Person_5.4] p on p.JobCanvasId = canvas.CanvasId
    inner join Person pers on pers.PersonId = p.PersonId
    inner join Company c on c.CompanyID = pers.CompanyId
    where act.NextDateD  between @StartDate and @EndDate

     order by  act.InteractionDateD  desc

     if(@Condition = 1)
     begin
        offset @SkipRows rows 
        fetch next @PageSize rows only
     end        


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

What are the differences between Standard SQL and Transact-SQL?

In this article, we'll explain syntax differences between standard SQL and the Transact-SQL language dedicated to interacting with the SQL

Sum Time columns in SQL

I'm writing a query to calculate when the students check-in and check-out and how much time they spend at the GYM. I have a Checking Field that contains the check-in time and a check-out field that contains the check-out, and a Duration.

T-SQL Training using Real World Scenarios:Tricks of the Trade | Simpliv

T-SQL Training using Real World Scenarios:Tricks of the Trade