Re: Calculate with today in if clause
Posted in 2006
Topics: General Discussion
Hi folks, Look at the detail: is today - 6570 > than today - 10950 or is today - 10950 > than today - 6570 ??? I mean the correct statement should be: if gebdat between (today - 10950) and (today - 6570) Of course, today -10950 is LESS than today - 6570 !! Best regards !! Ferronato emmermacher@hotmail.com escreveu: > Hello list. > > I'got a small problem with one report. > I have to write a report which results is an overview about age > distribution in one table > > I try to use the if statement like > if gebdat between (today - 6570) and (today - 10950) > > Gebdat is a date-type field. > How can get result a want to have? > IDS is an very old 7.30 > > Any ideas? > > Thanks in advance for your friendly advices. > > Best regards. > > Dirk Emmermacher
Hello Ferro. Thanks for your tip. I see that "between" is not right here. I changed my source code. Now it works. Best regards from Hannover, Germany. Dirk Emmermacher Ferro schrieb: > Hi folks, > > Look at the detail: is today - 6570 > than today - 10950 > or is today - 10950 > than today - 6570 ??? > I mean the correct statement should be: > > if gebdat between (today - 10950) and (today - 6570) > > Of course, today -10950 is LESS than today - 6570 !! > > Best regards !! > > Ferronato > > emmermacher@hotmail.com escreveu: > > > Hello list. > > > > I'got a small problem with one report. > > I have to write a report which results is an overview about age > > distribution in one table > > > > I try to use the if statement like > > if gebdat between (today - 6570) and (today - 10950) > > > > Gebdat is a date-type field. > > How can get result a want to have? > > IDS is an very old 7.30 > > > > Any ideas? > > > > Thanks in advance for your friendly advices. > > > > Best regards. > > > > Dirk Emmermacher
Nice catch, I read right past that and assumed it was correct. I was then puzzled about what was actually wrong. Ferro wrote: > Hi folks, > > Look at the detail: is today - 6570 > than today - 10950 > or is today - 10950 > than today - 6570 ??? > I mean the correct statement should be: > > if gebdat between (today - 10950) and (today - 6570) > > Of course, today -10950 is LESS than today - 6570 !! > > Best regards !! > > Ferronato > > emmermacher@hotmail.com escreveu: > > > Hello list. > > > > I'got a small problem with one report. > > I have to write a report which results is an overview about age > > distribution in one table > > > > I try to use the if statement like > > if gebdat between (today - 6570) and (today - 10950) > > > > Gebdat is a date-type field. > > How can get result a want to have? > > IDS is an very old 7.30 > > > > Any ideas? > > > > Thanks in advance for your friendly advices. > > > > Best regards. > > > > Dirk Emmermacher
If the original reporter had included the information that he was not getting any errors but no results were returned from the query we would have found the problem easier. So, remember to include notes about what is exactly happening. bozon wrote: > Nice catch, I read right past that and assumed it was correct. I was > then puzzled about what was actually wrong. > > Ferro wrote: > > Hi folks, > > > > Look at the detail: is today - 6570 > than today - 10950 > > or is today - 10950 > than today - 6570 ??? > > I mean the correct statement should be: > > > > if gebdat between (today - 10950) and (today - 6570) > > > > Of course, today -10950 is LESS than today - 6570 !! > > > > Best regards !! > > > > Ferronato > > > > emmermacher@hotmail.com escreveu: > > > > > Hello list. > > > > > > I'got a small problem with one report. > > > I have to write a report which results is an overview about age > > > distribution in one table > > > > > > I try to use the if statement like > > > if gebdat between (today - 6570) and (today - 10950) > > > > > > Gebdat is a date-type field. > > > How can get result a want to have? > > > IDS is an very old 7.30 > > > > > > Any ideas? > > > > > > Thanks in advance for your friendly advices. > > > > > > Best regards. > > > > > > Dirk Emmermacher