Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current Date does not work 1

Status
Not open for further replies.

WTKnow

Programmer
Aug 3, 2006
29
US
Hello!
I've successfully used formula to retrieve data until i started using current date in both places like from 8/30/2006 to 8/30/2006 brings me nothing.
Originally {@TransDate}was DateTime and now it is CDATE(field) so I converted it from DateTime into Date.
Any suggestions?
(
if {?StartDate} <> date(9999,9,9) then
{@TransDate}>= {?StartDate} else
if {?StartDate} = date(9999,9,9) then
true
)
and
(
if {?EndDate} <> date(9999,9,9) then
{@TransDate} <= {?EndDate} else
if {?EndDate} = date(9999,9,9) then
true
)
 
Why would you not post exactly what's in @transdate?

I suspect that is your problem, in future posts, please include nested formulas or don't bother posting, you're just wasting peoples time, we don't know what is in there.

And nothing in the formula appears to use currentdate, so what does the topic mean? If the formula is using a cdate, it's probably incorrectly applied, and a cdate has nothing to do with the current date, it converts character date fields to real dates, but since it allows for various formats, you may think that it's converting properly when it is not.

Tets by placing the formula on the details and see what is in there. In either case, share what is in there...

-k
 
I did post what is in @transdate - it is
CD({table.Transdate})which is as a field has DateTime type.
synapsevampire,
why such a hostility? You do not have to answer if you do not want to but bashing me like that...I am sorry I think it is really mean.

Topic means that when I am printing this Report for current date it gives me 6000 pages - for all dates I haven't asked for.
It works however if dates are different.
It works if dates are yesterday one or both.
Just current date gives problems...
 
Hi,
try:
Code:
if ( {?StartDate} <> date(9999,9,9) and {?EndDate} <> date(9999,9,9) )
then
({@TransDate}>= {?StartDate} and
{@TransDate} <= {?EndDate} )
else
true

If the parameters are correctly defined as Date types that should work..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Well search your 1st post, it does not show that formula, and the second formula wouldn't work either, CD is not a shortcut for cdate...

I'm not being mean, but I won't debate you, you will misundestand whatever I say anyway.

So I suggested that you test the field, which you decided not to do, or at least you decided not to post your findings.

CDATE is probably not doing what you expect, and entering todays date into the parameters shouldn't make a difference.

As you are probably aware, you don't understand nor communicate well in English, so try posting example data (a few examples of what's in the actual date field), and the actual formula you're using for cdate (I know, you like to think that you did this, but you did not, we don't want your interepretation of what is really in there).

It's probably best that you deal with someone who will do more hand holding, so I'll bug out of this thread and someone will pick it up and eventually get by your delicate dispostition and get some accurate information out of you.

By the way, successful posts tend to include:

Crystal version
Database/connectivity used
Example data
Expected output

Much as one would expect to gather as requirements for any professionally addressed project.

And the format for your parenthetical IF formula is something I developed years ago to resolve various issues in Crystal, and it works fine.

-k
 
Turkbear,
I don't know why but I think changing formula i used to what you suggested is working.
Thanks

 
Hi,
Probably some ( ) issues - it may have resulted in returning all records that met either date criteria, so it would have returned them ALL.

Glad it seems to work..But, synapsevampire 's advice ( he is a top supplier of valuable help here) should be followed for your future postings..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top