Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table divers
SELECT [Code Site]
,[Datedesdivers]
FROM [dbo].[Divers]
I need to get number of rows for data for the current year and month
How can I modify it ?
let noRows = NoOfRows('Divers')
May be create a temporary table with only current year and month of data and count the number of rows in it?
Divers:
SELECT [Code Site],
[Datedesdivers]
FROM [dbo].[Divers]
Temp:
NoConcatenate
LOAD *
Resident Divers
Where Num([Datedesdivers]) >= Num(MonthStart(Today()))
Let noRows = NoOfRows('Temp')
I'm assuming that the code is the SQL code, so try something like adding a 1 for each row loaded:
LOAD 1 As NoRows,
*;
SQL SELECT [Code Site]
,[Datedesdivers]
FROM [dbo].[Divers];
Then, on the front end, you can use Sum(NoRows) to get the number of rows for the current selections, on this table.
Regards,