How to list the last 7 days' birthdays with crystal reports and c # winforms

0

I am developing a church management system, and I need to get all the faithful registered in the system, whose birthday is in the last 7 days, counting with the current date. I have already created the following formulas:

CDate ({FIEIS.DataNasc_fl})>=CurrentDate-7

CDate ({FIEIS.DataNasc_fl})>=Last7Days

Both the first and the second formula did not work. If anyone has an idea how to do it, thank you very much!

@Motta! I tried the way you posted, gave the formula error:

    
asked by anonymous 13.12.2016 / 19:06

2 answers

0
(totext({Comando.NASC},"MMdd") >= totext(CurrentDate-7,"MMdd") and
 totext({Comando.NASC},"MMdd") <= totext(CurrentDate,"MMdd"))

Example I did here and it worked

    
13.12.2016 / 19:24
0

I FINALLY GOT PERSONAL! I did as follows:

1) I created 4 SQL Expression Fields:

data1: {fn DAYOFYEAR ("FIEIS". "DataNasc_fl")})

data2: ({fn DAYOFYEAR ({fn CURDATE ()})} - 7)

data3: {fn DAYOFYEAR ("FIESIS". "DataNasc_fl")}

data4: {fn DAYOFYEAR ({fn CURDATE ()}).

2) I created a formula "ult7dias" which looks like this:

{% data1} > = {% data2} and {% data3} < = {% data4}

And it worked! You're picking up the birthdays of the last 7 days !!! Many thanks to the brothers who gave me tips on this issue, especially at @Motta. I hope to always tell you the next few questions I have.

    
15.12.2016 / 12:53