0
I’m developing a church management system, and I need to get all the faithful registered in the system, whose birthday is in the last seven days, counting the current date. I have 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, I really appreciate it!
@Motta! I tried it the way you posted it, it was wrong in the formula:
! I tried it the way you posted it, it didn’t work. It’s a mistake.
– Daniel dos Santos
I’m also noticing the presence of extra parentheses.
– Daniel dos Santos
wouldn’t be less? totext((Currentdate),"yyyyMM")
– TotallyUncool
I’ve done it too, keep making the same mistake.
– Daniel dos Santos
People! It can also be as follows: Put two datetimepicker (starting date and end date), to be able to search in a given period. For the CR take the dates as parameters. If anyone knows, also thank you. Although the priority is really the first way.
– Daniel dos Santos
I changed my example, just change your field name
– Motta
Guys! mexi na formula e ficou assim: totext({FIEIS.DataNasc_fl}) >= totext((CurrentDate-7),"dd-MM") and
totext({FIEIS.DataNasc_fl}) <= totext((CurrentDate),"dd-MM"). In Crystal Ports no error is found. But when I select that formula in Lection expert and value put true, the report appears blank.
– Daniel dos Santos
@Motta. I tried again after the change, with Basic Syntax selects the first parenthesis and gives the following error: A statement is required here. With Crystal Syntax gives the following error: Too Many Arguments have been Given to this Function.
– Daniel dos Santos
It has to be Mmdd because it keeps the date hierarchy, the solution I made worked for a DATE field applied in the Record Filter. and has to have the "totext" at both ends of the test to compare homogeneous things (dates converted into month and day string)
– Motta
@Motta! I’m using Crystal Ports that comes bundled with VS2008. Does the Crystal Reports version have any infuence? 'Cause I’ve tried to do it the way it’s in the code that you’ve enhanced, and it keeps going wrong.
– Daniel dos Santos
When I remove "Mmdd" from the formula, CR finds no error in it, but the report appears empty.
– Daniel dos Santos
My field is Datetime. Does it matter?
– Daniel dos Santos
"makes a question" would our "make a difference" ? (laughs) I believe not , should work because the totext will make the conversion. What is the data source ? A solution could be via query , using (for example) EXTRACT Month/day FROM ...
– Motta
Here in Angola, we use both one and the other expression for the purpose (laughter). What exactly would this other solution look like?
– Daniel dos Santos