I need to get a formula to give the first and last day of the current month. This was done no problem in SQL Server but not so straightforward in Crystal. Using this for the first day:
DATEADD("m", DATEDIFF("m", #00/00/0000#, currentdatetime), #00/00/0000#)
Crystal doesn't like the 00/00/0000 date but if I use 01/01/2000 it misses the point. I need to calculate from 0 to get eg. 1st Aug and 31st Aug when given any day in August. In SQL, this works fine:
SELECT DATEADD(m, DATEDIFF(m, 0, getdate()), 0), DATEADD(m, DATEDIFF(m, 0, getdate())+1, 0)-1
How do I do it in Crystal, please?