Friday, June 21, 2024

SSRS - How to get first and last day in month

These are useful functions, for example for parameter filling:

First and last day of this month:
=dateadd("m",0,dateserial(year(Today),month(Today),1))
=dateadd("m",1,dateserial(year(Today),month(Today),0))
First and last day of last month:
=dateadd("m",-1,dateserial(year(Today),month(Today),1))
=dateadd("m",0,dateserial(year(Today),month(Today),0))
First and last day of next month:
=dateadd("m",1,dateserial(year(Today),month(Today),1))
=dateadd("m",2,dateserial(year(Today),month(Today),0))

Monday, June 17, 2024

c - How to solve error UNRESOLVED EXTERNAL SYMBOL for static class field

.h
class OverloadedOperator {
public:
	
	string name;
	float price;
 
	static int n;
};
The problem could be in missing static field initialization in .cpp file. Should be:

.cpp
#include "OverloadedOperator.h"

int OverloadedOperator::n = 0;